Skip to content

Commit afc67af

Browse files
authored
S3 josm jar (#5810)
* test archive url * maven version * josm 19043 system scope * testing pom and vendor jar * update script to use local jar
1 parent fee2895 commit afc67af

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

hoot-josm/make-hoot-josm-java.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,34 @@ JOSM_ARTIFACT_ID=`awk -F '[<>]' '/<josm.artifactId>/{print $3}' pom.xml`
88
JOSM_VERSION=`awk -F '[<>]' '/<josm.version>/{print $3}' pom.xml`
99
JOSM_JAR=$JOSM_ARTIFACT_ID-$JOSM_VERSION.jar
1010

11-
# Install a local josm jar if the version you want is not available from a repo. This needs to be
12-
# done first time for each new version of a local jar only. Download the jar and install it with the
13-
# mvn line below. You can check to see if your public josm jar is already installed by looking at
11+
# Install a local josm jar if the version you want is not available from a repo. This needs to be
12+
# done first time for each new version of a local jar only. Download the jar and install it with the
13+
# mvn line below. You can check to see if your public josm jar is already installed by looking at
1414
# the contents of ~/.m2/repository/org/openstreetmap/josm/<JOSM_ARTIFACT_ID>/<JOSM_VERSION>.
1515
# mvn install:install-file -Dfile=<path-to-jar> -DgroupId=org.openstreetmap.josm -DartifactId=<ID> -Dversion=<version> -Dpackaging=jar -DgeneratePom=true
1616

1717
# Build the hoot josm integration jar and copy over the josm jar.
1818
mvn -q package
1919

20-
# In order for our monkey patching of the josm jar to work, we need to remove the josm jar signature
20+
21+
# In order for our monkey patching of the josm jar to work, we need to remove the josm jar signature
2122
# so we don't get a security error.
2223
DEP_DIR=target/dependency-jars
23-
zip -qd $DEP_DIR/$JOSM_JAR "META-INF/*.MF"
24-
# Rename the josm jar to match what's in the hoot config.
25-
mv $DEP_DIR/$JOSM_JAR $DEP_DIR/josm.jar
24+
SRC_JAR=$DEP_DIR/$JOSM_JAR
25+
if [ ! -f "$SRC_JAR" ]; then
26+
# Fall back to the vendored system dependency location
27+
SRC_JAR=vendor/$JOSM_JAR
28+
fi
29+
if [ ! -f "$SRC_JAR" ]; then
30+
echo "ERROR: Could not find $JOSM_JAR in $DEP_DIR or vendor/. Make sure vendor/$JOSM_JAR exists for system-scoped builds." >&2
31+
exit 1
32+
fi
33+
34+
# Remove signature if present; ignore zip's 'Nothing to do' (exit 12)
35+
zip -qd "$SRC_JAR" "META-INF/*.MF" || [ $? -eq 12 ]
36+
37+
# Ensure destination dir exists and copy as josm.jar for hoot config
38+
install -d "$DEP_DIR"
39+
cp -f "$SRC_JAR" "$DEP_DIR/josm.jar"
2640

2741
cd $HOOT_HOME

hoot-josm/pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,20 @@
5656

5757
<dependencies>
5858
<dependency>
59-
<groupId>org.openstreetmap.josm</groupId>
60-
<artifactId>${josm.artifactId}</artifactId>
61-
<version>${josm.version}</version>
62-
</dependency>
59+
<groupId>org.openstreetmap.josm</groupId>
60+
<artifactId>josm</artifactId>
61+
<version>19043</version>
62+
<scope>system</scope>
63+
<systemPath>${project.basedir}/vendor/josm-19043.jar</systemPath>
64+
</dependency>
6365
</dependencies>
6466

6567
<build>
6668
<finalName>hoot-josm</finalName>
6769
<plugins>
6870

71+
72+
6973
<!-- Set a compiler level -->
7074
<plugin>
7175
<groupId>org.apache.maven.plugins</groupId>

hoot-josm/vendor/josm-19043.jar

16 MB
Binary file not shown.

0 commit comments

Comments
 (0)