@@ -8,20 +8,34 @@ JOSM_ARTIFACT_ID=`awk -F '[<>]' '/<josm.artifactId>/{print $3}' pom.xml`
88JOSM_VERSION=` awk -F ' [<>]' ' /<josm.version>/{print $3}' pom.xml`
99JOSM_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.
1818mvn -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.
2223DEP_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
2741cd $HOOT_HOME
0 commit comments