this directory (lib/) you should run:
$ mvn install:install-file \
+ -Dproject.parent.relativePath="" \
-DgroupId=org.unicode.cldr \
-DartifactId=cldr-api \
-Dversion=0.1-SNAPSHOT \
-DlocalRepositoryPath=. \
-Dfile=<CLDR_ROOT>/tools/java/cldr.jar
-And if you have updated one of these libraries then from the main project
-directory (i.e. the directory the Maven pom.xml file(s) are in) run:
+And if you have updated one of these libraries then from this directory run:
-$ mvn dependency:purge-local-repository -DsnapshotsOnly=true
+$ mvn dependency:purge-local-repository \
+ -Dproject.parent.relativePath="" \
+ -DmanualIncludes=org.unicode.cldr:cldr-api:jar
After doing this, you should see something like the following list of files in
this directory:
Finally, if you choose to update the version number of the snapshot, then also
update all the the pom.xml files which reference it (but this is unlikely to be
necessary).
+
+Troubleshooting
+---------------
+
+While the Maven system should keep the CLDR JAR up to date, there is a chance
+that you may have an out of date JAR installed elsewhere. If you have any
+issues with the JAR not being the expected version (e.g. after making changes)
+then run the above "purge" step again, from this directory.
+
+This should re-resolve the current JAR snapshot from the repository in this
+directory. Having purged the Maven cache, next time you build a project, you
+should see something like:
+
+[exec] Downloading from <xxx>: <url>/org/unicode/cldr/cldr-api/0.1-SNAPSHOT/maven-metadata.xml
+[exec] [INFO] Building jar: <path-to-icu-root>/tools/cldr/cldr-to-icu/target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar
+
+This shows that it has had to re-fetch the JAR file.
# The -B flag is "batch" mode and won't mess about with escape codes in the log file.
echo "Installing CLDR JAR file..."
run_with_logging mvn -B install:install-file \
+ -Dproject.parent.relativePath="" \
-DgroupId=org.unicode.cldr \
-DartifactId=cldr-api \
-Dversion=0.1-SNAPSHOT \
-Dfile="${CLDR_TOOLS_DIR}/cldr.jar"
echo "Syncing local Maven repository..."
-run_with_logging mvn -B dependency:purge-local-repository -DsnapshotsOnly=true
+run_with_logging mvn -B dependency:purge-local-repository \
+ -Dproject.parent.relativePath="" \
+ -DmanualIncludes=org.unicode.cldr:cldr-api:jar
mv -f "${LOG_FILE}" "last_log.txt"
echo "All done! (log file: last_log.txt)"
to identify the absolute path of a parent POM file). However since
child POM files should have a <parent> declaration with the relative
path in it, we can use that. Note however that this is a bit fragile
- and relies on <relativePath> being a directory, not a POM file. -->
+ and relies on <relativePath> being a directory, not a POM file.
+
+ In order to allow the local repository to work either when it is used
+ by a child POM file or when it's used directly (e.g. for installing
+ or purging the cache) when it is invoked from this directory, the
+ -Dproject.parent.relativePath=""
+ argument must be given. -->
<repositories>
<repository>
<id>local-maven-repo</id>