12e5b6d6dSopenharmony_ci********************************************************************* 22e5b6d6dSopenharmony_ci*** © 2019 and later: Unicode, Inc. and others. *** 32e5b6d6dSopenharmony_ci*** License & terms of use: http://www.unicode.org/copyright.html *** 42e5b6d6dSopenharmony_ci********************************************************************* 52e5b6d6dSopenharmony_ci 62e5b6d6dSopenharmony_ciWhat is this directory and why is it empty? 72e5b6d6dSopenharmony_ci------------------------------------------- 82e5b6d6dSopenharmony_ci 92e5b6d6dSopenharmony_ciThis is the root of a local Maven repository which needs to be populated before 102e5b6d6dSopenharmony_cicode which uses the CLDR data API can be executed. 112e5b6d6dSopenharmony_ci 122e5b6d6dSopenharmony_ciTo do this, you need to have a local copy of the CLDR project configured on your 132e5b6d6dSopenharmony_cicomputer and be able able to build the API jar file and copy an existing utility 142e5b6d6dSopenharmony_cijar file. In the examples below it is assumed that $CLDR_ROOT references this 152e5b6d6dSopenharmony_ciCLDR release. 162e5b6d6dSopenharmony_ci 172e5b6d6dSopenharmony_ciSetup 182e5b6d6dSopenharmony_ci----- 192e5b6d6dSopenharmony_ci 202e5b6d6dSopenharmony_ciThis project relies on the Maven build tool for managing dependencies and uses 212e5b6d6dSopenharmony_ciAnt for configuration purposes, so both will need to be installed. On a Debian 222e5b6d6dSopenharmony_cibased system, this should be as simple as: 232e5b6d6dSopenharmony_ci 242e5b6d6dSopenharmony_ci$ sudo apt-get install maven ant 252e5b6d6dSopenharmony_ci 262e5b6d6dSopenharmony_ci 272e5b6d6dSopenharmony_ciInstalling the CLDR API jar 282e5b6d6dSopenharmony_ci--------------------------- 292e5b6d6dSopenharmony_ci 302e5b6d6dSopenharmony_ciFrom this directory: 312e5b6d6dSopenharmony_ci 322e5b6d6dSopenharmony_ci$ ./install-cldr-jars.sh "$CLDR_DIR" 332e5b6d6dSopenharmony_ci 342e5b6d6dSopenharmony_ci 352e5b6d6dSopenharmony_ciManually installing the CLDR API jar 362e5b6d6dSopenharmony_ci------------------------------------ 372e5b6d6dSopenharmony_ci 382e5b6d6dSopenharmony_ciOnly follow these remaining steps if the installation script isn't suitable or 392e5b6d6dSopenharmony_cidoesn't work on your system. 402e5b6d6dSopenharmony_ci 412e5b6d6dSopenharmony_ciTo regenerate the CLDR API jar you need to build the "jar" target manually 422e5b6d6dSopenharmony_ciusing the Maven pom.xml file in the "tools" directory of the CLDR project: 432e5b6d6dSopenharmony_ci 442e5b6d6dSopenharmony_ci$ cd "$CLDR_ROOT/tools" 452e5b6d6dSopenharmony_ci$ mvn package -DskipTests=true 462e5b6d6dSopenharmony_ci 472e5b6d6dSopenharmony_ciThis should result in the cldr-code.jar file being built into the cldr-code/target 482e5b6d6dSopenharmony_cisub-directory, which can then be installed as a Maven dependency as described above. 492e5b6d6dSopenharmony_ci 502e5b6d6dSopenharmony_ci 512e5b6d6dSopenharmony_ciUpdating local Maven repository 522e5b6d6dSopenharmony_ci------------------------------- 532e5b6d6dSopenharmony_ci 542e5b6d6dSopenharmony_ciTo update the local Maven repository (e.g. to install the CLDR jar) then from 552e5b6d6dSopenharmony_cithis directory (lib/) you should run: 562e5b6d6dSopenharmony_ci 572e5b6d6dSopenharmony_ci$ mvn install:install-file \ 582e5b6d6dSopenharmony_ci -Dproject.parent.relativePath="" \ 592e5b6d6dSopenharmony_ci -DgroupId=org.unicode.cldr \ 602e5b6d6dSopenharmony_ci -DartifactId=cldr-api \ 612e5b6d6dSopenharmony_ci -Dversion=0.1-SNAPSHOT \ 622e5b6d6dSopenharmony_ci -Dpackaging=jar \ 632e5b6d6dSopenharmony_ci -DgeneratePom=true \ 642e5b6d6dSopenharmony_ci -DlocalRepositoryPath=. \ 652e5b6d6dSopenharmony_ci -Dfile="$CLDR_ROOT/tools/cldr-code/target/cldr-code.jar" 662e5b6d6dSopenharmony_ci 672e5b6d6dSopenharmony_ciAnd if you have updated one of these libraries then from this directory run: 682e5b6d6dSopenharmony_ci 692e5b6d6dSopenharmony_ci$ mvn dependency:purge-local-repository \ 702e5b6d6dSopenharmony_ci -Dproject.parent.relativePath="" \ 712e5b6d6dSopenharmony_ci -DmanualIncludes=org.unicode.cldr:cldr-api:jar 722e5b6d6dSopenharmony_ci 732e5b6d6dSopenharmony_ciAfter doing this, you should see something like the following list of files in 742e5b6d6dSopenharmony_cithis directory: 752e5b6d6dSopenharmony_ci 762e5b6d6dSopenharmony_ciREADME.txt <-- this file 772e5b6d6dSopenharmony_ciorg/unicode/cldr/cldr-api/maven-metadata-local.xml 782e5b6d6dSopenharmony_ciorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/maven-metadata-local.xml 792e5b6d6dSopenharmony_ciorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/cldr-api-0.1-SNAPSHOT.pom 802e5b6d6dSopenharmony_ciorg/unicode/cldr/cldr-api/0.1-SNAPSHOT/cldr-api-0.1-SNAPSHOT.jar 812e5b6d6dSopenharmony_ci 822e5b6d6dSopenharmony_ciFinally, if you choose to update the version number of the snapshot, then also 832e5b6d6dSopenharmony_ciupdate all the the pom.xml files which reference it (but this is unlikely to be 842e5b6d6dSopenharmony_cinecessary). 852e5b6d6dSopenharmony_ci 862e5b6d6dSopenharmony_ciTroubleshooting 872e5b6d6dSopenharmony_ci--------------- 882e5b6d6dSopenharmony_ci 892e5b6d6dSopenharmony_ciWhile the Maven system should keep the CLDR JAR up to date, there is a chance 902e5b6d6dSopenharmony_cithat you may have an out of date JAR installed elsewhere. If you have any 912e5b6d6dSopenharmony_ciissues with the JAR not being the expected version (e.g. after making changes) 922e5b6d6dSopenharmony_cithen run the above "purge" step again, from this directory. 932e5b6d6dSopenharmony_ci 942e5b6d6dSopenharmony_ciThis should re-resolve the current JAR snapshot from the repository in this 952e5b6d6dSopenharmony_cidirectory. Having purged the Maven cache, next time you build a project, you 962e5b6d6dSopenharmony_cishould see something like: 972e5b6d6dSopenharmony_ci 982e5b6d6dSopenharmony_ci[exec] Downloading from <xxx>: <url>/org/unicode/cldr/cldr-api/0.1-SNAPSHOT/maven-metadata.xml 992e5b6d6dSopenharmony_ci[exec] [INFO] Building jar: <path-to-icu-root>/tools/cldr/cldr-to-icu/target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar 1002e5b6d6dSopenharmony_ci 1012e5b6d6dSopenharmony_ciThis shows that it has had to re-fetch the JAR file. 102