From 45e98d4f67e6d88c29d70fb8f5322d549066f76d Mon Sep 17 00:00:00 2001 From: Elango Cheran Date: Wed, 7 Dec 2022 05:16:30 +0000 Subject: [PATCH] ICU-12811 Build ICU4J using Maven See #2251 --- .github/workflows/icu_ci.yml | 48 +++ .gitignore | 1 + icu4j/maven-build/README.md | 120 ++++++ .../73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.jar | 3 + .../73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.pom | 13 + .../73.1-SNAPSHOT/maven-metadata-local.xml | 28 ++ .../ibm/icu/icudata/maven-metadata-local.xml | 15 + .../73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.jar | 3 + .../73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.pom | 13 + .../73.1-SNAPSHOT/maven-metadata-local.xml | 28 ++ .../icu/icutzdata/maven-metadata-local.xml | 15 + .../73.1-SNAPSHOT/maven-metadata-local.xml | 28 ++ .../73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.jar | 3 + .../73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.pom | 13 + .../ibm/icu/testdata/maven-metadata-local.xml | 15 + .../maven-build/maven-icu4j-charset/README.md | 15 + icu4j/maven-build/maven-icu4j-charset/pom.xml | 240 ++++++++++++ .../maven-icu4j-datafiles/README.md | 15 + .../maven-build/maven-icu4j-datafiles/pom.xml | 98 +++++ .../maven-icu4j-localespi/README.md | 15 + .../maven-build/maven-icu4j-localespi/pom.xml | 242 ++++++++++++ .../maven-icu4j-test-datafiles/README.md | 15 + .../maven-icu4j-test-datafiles/pom.xml | 92 +++++ icu4j/maven-build/maven-icu4j/README.md | 15 + .../maven-icu4j/create-fullLocaleNames.sh | 18 + .../maven-icu4j/file-listing-helper.sh | 11 + icu4j/maven-build/maven-icu4j/pom.xml | 336 ++++++++++++++++ icu4j/maven-build/pom.xml | 363 ++++++++++++++++++ 28 files changed, 1821 insertions(+) create mode 100644 icu4j/maven-build/README.md create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.jar create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.pom create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/maven-metadata-local.xml create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/maven-metadata-local.xml create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.jar create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.pom create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/maven-metadata-local.xml create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/maven-metadata-local.xml create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/maven-metadata-local.xml create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.jar create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.pom create mode 100644 icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/maven-metadata-local.xml create mode 100644 icu4j/maven-build/maven-icu4j-charset/README.md create mode 100644 icu4j/maven-build/maven-icu4j-charset/pom.xml create mode 100644 icu4j/maven-build/maven-icu4j-datafiles/README.md create mode 100644 icu4j/maven-build/maven-icu4j-datafiles/pom.xml create mode 100644 icu4j/maven-build/maven-icu4j-localespi/README.md create mode 100644 icu4j/maven-build/maven-icu4j-localespi/pom.xml create mode 100644 icu4j/maven-build/maven-icu4j-test-datafiles/README.md create mode 100644 icu4j/maven-build/maven-icu4j-test-datafiles/pom.xml create mode 100644 icu4j/maven-build/maven-icu4j/README.md create mode 100755 icu4j/maven-build/maven-icu4j/create-fullLocaleNames.sh create mode 100755 icu4j/maven-build/maven-icu4j/file-listing-helper.sh create mode 100644 icu4j/maven-build/maven-icu4j/pom.xml create mode 100644 icu4j/maven-build/pom.xml diff --git a/.github/workflows/icu_ci.yml b/.github/workflows/icu_ci.yml index 3c6364be355..ec43e9e4017 100644 --- a/.github/workflows/icu_ci.yml +++ b/.github/workflows/icu_ci.yml @@ -55,6 +55,54 @@ jobs: [ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`; if: ${{ failure() }} + # Java8 ICU4J build and unit tests using Maven + # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + + # Run `test` to execute unit tests and ensure it is possible for tests to run even without packaging submodule + # dependencies as jar files + java8-icu4j-test-maven: + name: Run unit tests with Maven using JDK 8 + runs-on: ubuntu-latest + steps: + - name: Checkout and setup + uses: actions/checkout@v2 + with: + lfs: true + - name: Checkout lfs objects + run: git lfs pull + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + cache: maven + - name: Run Maven test + run: | + cd icu4j/maven-build; + mvn --batch-mode test + + # Run `verify` to ensure that `package` (creating .jar files) and `integration-test` (special setup for localespi tests) work + java8-icu4j-verify-maven: + name: Run integration tests with Maven using JDK 8 + runs-on: ubuntu-latest + steps: + - name: Checkout and setup + uses: actions/checkout@v2 + with: + lfs: true + - name: Checkout lfs objects + run: git lfs pull + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + cache: maven + # The Maven `verify` phase causes the following to happen first, and in order: + # build/compile (`compile`), unit tests (`test`), Jar building (`package`), + # integration tests, if any (`integration-test`) + - name: Run Maven verify + run: | + cd icu4j/maven-build; + mvn --batch-mode verify # ICU4J build and unit test under Java11 java11-icu4j-build-and-test: diff --git a/.gitignore b/.gitignore index 9d0654d4183..566ca3970a0 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ lib/ !tools/cldr/lib out/ release/ +target/ !docs/processes/release/ tmp/ x64/ diff --git a/icu4j/maven-build/README.md b/icu4j/maven-build/README.md new file mode 100644 index 00000000000..1549f656175 --- /dev/null +++ b/icu4j/maven-build/README.md @@ -0,0 +1,120 @@ + + +# ICU4J Maven Build + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. + +Note: This directory is the root of the directory structure that defines +the Maven build without changing the existing code structure and Ant build. + +## Usage + +Maven is a pretty standard build tool in the Java ecosystem with a very well-defined +preferred way to do file layout and build execution. +Thus, many IDEs for Java will have some level of support for Maven. +The command line invocation is still, of course, the standard of truth for the build. + +In this current setup for the ICU4J Maven build, in which the existing file layout and +processes remain the same in order to keep the Ant build unchanged, +the Maven build is configured in ways that are non-standard for a typical Maven setup. +Therefore, IDE support for this non-standard Maven build might be less than if ICUJ4's +directories and build process were modified to be more consistent with Maven expectations. +However, there still exist IDEs with good support, and the results of the command line +invocation's test and artifact jar packaging are designed to be equivalent to the Ant build. + +### Usage in IDEs + +Users of IDEs should familiarize themselves with the information about how to use Maven at +the command line, +which also includes information about Maven builds. + +#### IntelliJ + +IntelliJ does a good job of understanding multi-module Maven projects, +including the non-standard configuration here. +It also recognizes the customized locations of source code files and test code files in the configuration here. + +To import into IntelliJ: + +1. In IntelliJ, open a new project. + a. Recent versions of IntelliJ provide a dialog box on startup to select a project. Click the "Open" button.) +2. Select the `pom.xml` in this same directory (ex: `/icu4j/maven-build/pom.xml`) +3. That's it. Note: IntelliJ will take a few minutes to do a one-time indexing of the new source code. + +Navigating the source code files between main code and test code, and running tests individually or for an entire module, +work as they do normally in IntelliJ. + +#### VS Code + +VS Code's support of Maven projects is not as robust as IntelliJ's when it comes to the non-standard file layout for sources and tests. +The Maven support comes from the standard Java extension (which depends on the standard Maven extension) from the extension marketplace. +Source and test code files are not recognized properly, and it is not clear how to execute the tests. + +However, a workaround exists for those who want to use VS Code as their preferred editor and still execute commands to recompile or run tests. +The workaround relies on invoking the Maven commands in a shell, and using a VS Code extension to create shortcuts within the IDE to invoke those commands. + +The extension is [Command Runner](https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner). +Next, create a VS Code workspace (File > Open Folder...) at the ICU4J root at `/icu4j`. +Then edit your settings for your VS Code workspace for ICU4J (this is the file at `/icu4j/.vscode/settings.json`) +by adding this section to the settings: + +```json +{ + ... + "command-runner.commands": { + // The following commands assume your VS Code workspace is rooted at `/icu4j`. If not, + // then adjust accordingly. + "core > all > compile": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j compile", + "core > all > test": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j test -DfailIfNoTests=false", + "core > number > test": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j test -Dtest=\"com.ibm.icu.dev.test.number.*,com.ibm.icu.dev.impl.number.*\" -DfailIfNoTests=false", + "core > text > test": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j test -Dtest=\"com.ibm.icu.dev.test.text.*\" -DfailIfNoTests=false", + "charset > compile": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j-charset compile", + "charset > test": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j-charset test -DfailIfNoTests=false", + "localespi > compile": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j-localespi compile", + "localespi > test": "cd ${workspaceFolder}/maven-build; mvn -am -pl maven-icu4j-localespi test -DfailIfNoTests=false", + } + ... +} +``` + +As the extension's documentation describes, there are multiple ways to open up the palette of command shortcuts. +One way is to hit Ctrl/Cmd+Shift+P, then type "Run Command", then hit enter. +Another way is to right-click the background of any editor pane. + +After the palette appears, you can choose which Maven build target to execute. + +#### Eclipse + +Although Eclipse's Maven plugin works reasonably well and can support the import of a multi-module Maven project, +the non-Maven-standard layout that it currently has seems to prevent an effective usage. +In particular, even though Eclipse can be configured to build the project, +it does not dispay the source code files and test code files for editing within the IDE through any of the usual Views. + +### Usage at the command line + +Maven divides its concept of a build into a "lifecycle" of a linear sequence of steps, called "phases". +These phases have a predefined order, and each phase can only begin if all of the previous phases have finished successfully. +Phases also serve as default build targets. +The sequence of phases include ... `compile` ... `test` ... `package` ... `integration-test` ... `deploy`. + +At the root of the project, you can run `mvn compile` to build/compile, and `mvn test` to run all of the tests (after first compiling successfully). + +To only execute a command within a submodule of the project, from the root, use the `-am -pl ` syntax like this: +``` +mvn test -am -pl maven-icu4j +``` +where `` is a comma-separated list of names of the subfolders which contain the submodule configuration pom.xml files. + +If you want to run only a specific test(s), use the `-Dtest=""` option, where `` can be a test name, a class name / package prefix, or a comma-separate list of them. + +If you want to skip tests, use the `-DskipTests=true` option. diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.jar b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.jar new file mode 100644 index 00000000000..d032cad0a1e --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54e9a192377b1032381e29d7544e710bd126cc21187961aafa6e93792d989bc1 +size 14175366 diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.pom b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.pom new file mode 100644 index 00000000000..19bbe8b25c4 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/icudata-73.1-SNAPSHOT.pom @@ -0,0 +1,13 @@ + + + + 4.0.0 + com.ibm.icu + icudata + 73.1-SNAPSHOT + POM was created from install:install-file + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/maven-metadata-local.xml new file mode 100644 index 00000000000..7b0ca754360 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/73.1-SNAPSHOT/maven-metadata-local.xml @@ -0,0 +1,28 @@ + + + + com.ibm.icu + icudata + + 20221207000422 + + true + + + + jar + 73.1-SNAPSHOT + 20221207000422 + + + pom + 73.1-SNAPSHOT + 20221207000422 + + + + 73.1-SNAPSHOT + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/maven-metadata-local.xml new file mode 100644 index 00000000000..ae3c5a2d248 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icudata/maven-metadata-local.xml @@ -0,0 +1,15 @@ + + + + com.ibm.icu + icudata + + + 73.1-SNAPSHOT + + 20221207000422 + + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.jar b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.jar new file mode 100644 index 00000000000..6ea73eee57e --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2154e3d3fba1741cd55258a9c3ef33898c033af917951f2b44d1220912705cc9 +size 93607 diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.pom b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.pom new file mode 100644 index 00000000000..e1e5099d70f --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/icutzdata-73.1-SNAPSHOT.pom @@ -0,0 +1,13 @@ + + + + 4.0.0 + com.ibm.icu + icutzdata + 73.1-SNAPSHOT + POM was created from install:install-file + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/maven-metadata-local.xml new file mode 100644 index 00000000000..f631a8f66ab --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/73.1-SNAPSHOT/maven-metadata-local.xml @@ -0,0 +1,28 @@ + + + + com.ibm.icu + icutzdata + + 20221207000426 + + true + + + + jar + 73.1-SNAPSHOT + 20221207000426 + + + pom + 73.1-SNAPSHOT + 20221207000426 + + + + 73.1-SNAPSHOT + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/maven-metadata-local.xml new file mode 100644 index 00000000000..c6a62aa8d24 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/icutzdata/maven-metadata-local.xml @@ -0,0 +1,15 @@ + + + + com.ibm.icu + icutzdata + + + 73.1-SNAPSHOT + + 20221207000426 + + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/maven-metadata-local.xml new file mode 100644 index 00000000000..faf82e207bc --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/maven-metadata-local.xml @@ -0,0 +1,28 @@ + + + + com.ibm.icu + testdata + + 20221207000430 + + true + + + + jar + 73.1-SNAPSHOT + 20221207000430 + + + pom + 73.1-SNAPSHOT + 20221207000430 + + + + 73.1-SNAPSHOT + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.jar b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.jar new file mode 100644 index 00000000000..b8075b46a8e --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6c10566f57e9f09ae050bc038f87a9a054b5ccc019e7b41ac72ca1b44410c1d +size 831615 diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.pom b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.pom new file mode 100644 index 00000000000..f681e6dddf5 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/73.1-SNAPSHOT/testdata-73.1-SNAPSHOT.pom @@ -0,0 +1,13 @@ + + + + 4.0.0 + com.ibm.icu + testdata + 73.1-SNAPSHOT + POM was created from install:install-file + diff --git a/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/maven-metadata-local.xml b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/maven-metadata-local.xml new file mode 100644 index 00000000000..d365218be90 --- /dev/null +++ b/icu4j/maven-build/local-maven-repo/com/ibm/icu/testdata/maven-metadata-local.xml @@ -0,0 +1,15 @@ + + + + com.ibm.icu + testdata + + + 73.1-SNAPSHOT + + 20221207000430 + + diff --git a/icu4j/maven-build/maven-icu4j-charset/README.md b/icu4j/maven-build/maven-icu4j-charset/README.md new file mode 100644 index 00000000000..5221bf98a4c --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-charset/README.md @@ -0,0 +1,15 @@ + + +# maven-icu4j-charset + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j-charset/pom.xml b/icu4j/maven-build/maven-icu4j-charset/pom.xml new file mode 100644 index 00000000000..bc9ff1419b1 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-charset/pom.xml @@ -0,0 +1,240 @@ + + + + + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + + + 4.0.0 + + com.ibm.icu + icu4j-charset + 73.1-SNAPSHOT + + jar + + ICU4J Charset Provider + icu4j-charset is a supplemental library for icu4j, implementing Java Charset SPI. + + + + org.ibm.icu.charset + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + add-source + + add-source + + + + ../../main/classes/charset/src + + + + + + + add-test-source + + add-test-source + + + + ../../main/tests/charset/src + ../../main/tests/framework/src + + + + + + + add-resource + + add-resource + + + + + ../../main/classes/charset/src + + **/*.java + + + + + + + + + add-test-resource + + add-test-resource + + + + + ../../main/tests/charset/src + + **/*.java + + + + ../../main/tests/framework/src + + **/*.java + + + + + + + + + + + + + maven-remote-resources-plugin + + + process-remote-resources + + process + + + + com.ibm.icu:icu4j-datafiles:${icu4j.version} + com.ibm.icu:icu4j-test-datafiles:${icu4j.version} + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-dependencies + prepare-package + + unpack-dependencies + + + com.ibm.icu + + provided + **/*.cnv,**/cnvalias.icu + **/*.jar + ${project.build.directory}/classes + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + ${maven.compiler.source} + ${maven.compiler.target} + + ${jar.spec.title} + ${jar.spec.version} + ${jar.spec.vendor} + + ${jar.impl.title} + ${jar.impl.version} + ${jar.impl.vendor} + ${jar.impl.vendor.id} + + ${jar.manifest.version} + ${jar.name} + ${jar.description} + ${jar.symbolic.name} + ${jar.version} + ${jar.vendor} + ${jar.copyright.info} + + + ${jar.main.class} + + + + + + + + + + + + com.ibm.icu + icu4j + + + + com.ibm.icu + icu4j-test-datafiles + provided + + + + junit + junit + test + + + + + pl.pragmatists + JUnitParams + test + + + + + diff --git a/icu4j/maven-build/maven-icu4j-datafiles/README.md b/icu4j/maven-build/maven-icu4j-datafiles/README.md new file mode 100644 index 00000000000..5221bf98a4c --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-datafiles/README.md @@ -0,0 +1,15 @@ + + +# maven-icu4j-charset + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j-datafiles/pom.xml b/icu4j/maven-build/maven-icu4j-datafiles/pom.xml new file mode 100644 index 00000000000..48937f00557 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-datafiles/pom.xml @@ -0,0 +1,98 @@ + + + + + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + + + 4.0.0 + + com.ibm.icu + icu4j-datafiles + 73.1-SNAPSHOT + + jar + + ICU4J Data Files + Various *.jar files needed by ICU4J components' main code. + + + + + + local-maven-repo + file:${basedir}/../local-maven-repo + + + + + + + com.ibm.icu + icudata + + + + com.ibm.icu + icutzdata + + + + + + + + maven-remote-resources-plugin + + + process-remote-resources + + bundle + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-dependencies + prepare-package + + unpack-dependencies + + + com.ibm.icu + **/*.jar + ${project.build.directory}/classes + + + + + + + + diff --git a/icu4j/maven-build/maven-icu4j-localespi/README.md b/icu4j/maven-build/maven-icu4j-localespi/README.md new file mode 100644 index 00000000000..af2febcf4df --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-localespi/README.md @@ -0,0 +1,15 @@ + + +# maven-icu4j-localespi + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j-localespi/pom.xml b/icu4j/maven-build/maven-icu4j-localespi/pom.xml new file mode 100644 index 00000000000..bccecd08527 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-localespi/pom.xml @@ -0,0 +1,242 @@ + + + + + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + + + 4.0.0 + + com.ibm.icu + icu4j-localespi + 73.1-SNAPSHOT + + jar + + ICU4J Locale Service Provider + icu4j-localespi is a supplemental library for icu4j, implementing Java Locale SPI. + + + + org.ibm.icu.localespi + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + add-source + + add-source + + + + ../../main/classes/localespi/src + + + + + + + add-test-source + + add-test-source + + + + ../../main/tests/localespi/src + ../../main/tests/framework/src + + + + + + + add-resource + + add-resource + + + + + ../../main/classes/localespi/src + + **/*.java + + + + + + + + + add-test-resource + + add-test-resource + + + + + ../../main/tests/localespi/src + + **/*.java + + + + ../../main/tests/framework/src + + **/*.java + + + + + + + + + + + + maven-surefire-plugin + + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + + + + + + + **/*.java + + **/IT*.java + **/*IT.java + **/*ITCase.java + + + + + + ${project.build.directory} + + SPI,JRE + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + ${maven.compiler.source} + ${maven.compiler.target} + + ${jar.spec.title} + ${jar.spec.version} + ${jar.spec.vendor} + + ${jar.impl.title} + ${jar.impl.version} + ${jar.impl.vendor} + ${jar.impl.vendor.id} + + ${jar.manifest.version} + ${jar.name} + ${jar.description} + ${jar.symbolic.name} + ${jar.version} + ${jar.vendor} + ${jar.copyright.info} + + + ${jar.main.class} + + + + + + + + + + + + com.ibm.icu + icu4j + + + + com.ibm.icu + icu4j-test-datafiles + provided + + + + junit + junit + + + + + pl.pragmatists + JUnitParams + + + + + diff --git a/icu4j/maven-build/maven-icu4j-test-datafiles/README.md b/icu4j/maven-build/maven-icu4j-test-datafiles/README.md new file mode 100644 index 00000000000..5221bf98a4c --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-test-datafiles/README.md @@ -0,0 +1,15 @@ + + +# maven-icu4j-charset + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j-test-datafiles/pom.xml b/icu4j/maven-build/maven-icu4j-test-datafiles/pom.xml new file mode 100644 index 00000000000..e2aa3bfbf37 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j-test-datafiles/pom.xml @@ -0,0 +1,92 @@ + + + + + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + + + 4.0.0 + + com.ibm.icu + icu4j-test-datafiles + 73.1-SNAPSHOT + + jar + + ICU4J Test Data Files + Various *.jar files needed by ICU4J components' test code. + + + + icu4j-releases + ICU4J Central Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + icu4j-snapshots + ICU4J Central Development Repository + https://oss.sonatype.org/content/repositories/snapshots + + + + + + + + local-maven-repo + file:${basedir}/../local-maven-repo + + + + + + + + com.ibm.icu + testdata + + + + + + + + maven-remote-resources-plugin + + + process-remote-resources + + bundle + + + + + + + + + + diff --git a/icu4j/maven-build/maven-icu4j/README.md b/icu4j/maven-build/maven-icu4j/README.md new file mode 100644 index 00000000000..6619a1a33d6 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j/README.md @@ -0,0 +1,15 @@ + + +# maven-icu4j + +This directory exists as part of work to build ICU4J with Maven. +Specifically, this directory was created to exist alongside the code +directory structure without changing it. +This preserves the existing behavior of Ant build targets and BRS tasks / artifact +deploy processes based on the output of those Ant builds. + +If / when the Ant build is suitable to be replaced and remove by Maven +or other such build tool, this directory should be removed. \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j/create-fullLocaleNames.sh b/icu4j/maven-build/maven-icu4j/create-fullLocaleNames.sh new file mode 100755 index 00000000000..d38668ba57e --- /dev/null +++ b/icu4j/maven-build/maven-icu4j/create-fullLocaleNames.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This command lists all the resource files in a single directory that we want to match on. +# Then we filter the locale resource files, based on the file name, using the same match pattern +# used in the corresponding target in the Ant build.xml configuration. +# Then, we store the locale names in a file in that directory, which ICUResourceBundle.java might look for. +# +# Input argument $1 = directory containing containing *.res files +ls $1/*.res\ + | ruby -lane 'puts "basename "+$F[0]' \ + | sh \ + | ruby -lane 'puts $F[0].match(/^(..\.res|.._.*\.res|...\.res|..._.*\.res|root.res)$/)' \ + | egrep -v "res_index.res|^$" \ + | ruby -lane 'puts $F[0].match(/(.*).res$/)[1]' \ + | sort \ + > $1/fullLocaleNames.lst \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j/file-listing-helper.sh b/icu4j/maven-build/maven-icu4j/file-listing-helper.sh new file mode 100755 index 00000000000..ef98f48de37 --- /dev/null +++ b/icu4j/maven-build/maven-icu4j/file-listing-helper.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# For every directory in the locale data files, the Ant build creates a file with the +# names of all locales. Find all such directories and execute the script that replicates +# the logic of generating that file. +# +# Command is intended to run from the root of the directory of the Maven submodule project +# in which the shaded/assembly/uberjar is being created (ex: for the `icu4j` artifact). +find target/classes/com/ibm/icu/impl/data/* -type d -exec ./create-fullLocaleNames.sh {} \; \ No newline at end of file diff --git a/icu4j/maven-build/maven-icu4j/pom.xml b/icu4j/maven-build/maven-icu4j/pom.xml new file mode 100644 index 00000000000..658db5a045b --- /dev/null +++ b/icu4j/maven-build/maven-icu4j/pom.xml @@ -0,0 +1,336 @@ + + + + + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + + + 4.0.0 + + com.ibm.icu + icu4j + 73.1-SNAPSHOT + + jar + + ICU4J + International Component for Unicode for Java (ICU4J) is a mature, widely used Java library providing Unicode and Globalization support + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + add-source + + add-source + + + + ../../main/classes/collate/src + ../../main/classes/core/src + ../../main/classes/currdata/src + ../../main/classes/langdata/src + ../../main/classes/regiondata/src + ../../main/classes/translit/src + + + + + + + add-test-source + + add-test-source + + + + ../../main/tests/collate/src + ../../main/tests/core/src + ../../main/tests/framework/src + ../../main/tests/packaging/src + ../../main/tests/translit/src + ../../tools/misc/src + + + + + + + add-resource + + add-resource + + + + + ../../main/classes/collate/src + + **/*.java + + + + ../../main/classes/core/src + + **/*.java + + + + ../../main/classes/currdata/src + + **/*.java + + + + ../../main/classes/langdata/src + + **/*.java + + + + ../../main/classes/regiondata/src + + **/*.java + + + + ../../main/classes/translit/src + + **/*.java + + + + + + + + + add-test-resource + + add-test-resource + + + + + ../../main/tests/collate/src + + **/*.java + + + + ../../main/tests/core/src + + **/*.java + + + + ../../main/tests/framework/src + + **/*.java + + + + ../../main/tests/packaging/src + + **/*.java + + + + ../../main/tests/translit/src + + **/*.java + + + + ../../tools/misc/src + + **/*.java + + + + + + + + + + + + + maven-remote-resources-plugin + + + process-remote-resources + + process + + + + com.ibm.icu:icu4j-datafiles:${icu4j.version} + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-dependencies + prepare-package + + unpack-dependencies + + + com.ibm.icu + + provided + **/*.cnv,**/cnvalias.icu,**/*.jar + ${project.build.directory}/classes + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + + full-locale-names + prepare-package + + exec + + + ./file-listing-helper.sh + + + + + copy-license-file + prepare-package + + exec + + + cp + + ../../../icu4c/LICENSE + ${project.build.directory}/classes + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + ${maven.compiler.source} + ${maven.compiler.target} + + ${jar.spec.title} + ${jar.spec.version} + ${jar.spec.vendor} + + ${jar.impl.title} + ${jar.impl.version} + ${jar.impl.vendor} + ${jar.impl.vendor.id} + + ${jar.manifest.version} + ${jar.name} + ${jar.description} + ${jar.symbolic.name} + ${jar.version} + ${jar.vendor} + ${jar.copyright.info} + + + ${jar.main.class} + + + + + + + + + + + + + com.ibm.icu + icu4j-datafiles + + + + com.ibm.icu + icu4j-test-datafiles + provided + + + + junit + junit + test + + + + + pl.pragmatists + JUnitParams + test + + + + + diff --git a/icu4j/maven-build/pom.xml b/icu4j/maven-build/pom.xml new file mode 100644 index 00000000000..871a7d5130b --- /dev/null +++ b/icu4j/maven-build/pom.xml @@ -0,0 +1,363 @@ + + + + 4.0.0 + + com.ibm.icu + icu4j-root + 73.1-SNAPSHOT + + pom + + ICU4J Root + + International Component for Unicode for Java (ICU4J) is a mature, widely used Java library + providing Unicode and Globalization support + + https://icu.unicode.org/ + 2001 + + + + Unicode/ICU License + https://raw.githubusercontent.com/unicode-org/icu/main/icu4c/LICENSE + repo + + + + + + macchiati + Mark Davis + Google + + PMC Member + + + + JCEmmons + John Emmons + IBM Corporation + + PMC Member + + + + dougfelt + Doug Felt + Google + + PMC Member + + + + deborah + Deborah Goldsmith + Apple + + PMC Member + + + + srl295 + Steven Loomis + IBM Corporation + + PMC Member + + + + markusicu + Markus Scherer + Google + + PMC Member + + + + pedberg + Peter Edberg + Apple + + PMC Member + + + + yumaoka + Yoshito Umaoka + IBM Corporation + + PMC Member + + + + + + + icu-support + https://lists.sourceforge.net/lists/listinfo/icu-support + https://lists.sourceforge.net/lists/listinfo/icu-support + icu-support@lists.sourceforge.net + http://sourceforge.net/mailarchive/forum.php?forum_name=icu-support + + + icu-announce + https://lists.sourceforge.net/lists/listinfo/icu-announce + https://lists.sourceforge.net/lists/listinfo/icu-announce + icu-announce@lists.sourceforge.net + http://sourceforge.net/mailarchive/forum.php?forum_name=icu-announce + + + icu-design + https://lists.sourceforge.net/lists/listinfo/icu-design + https://lists.sourceforge.net/lists/listinfo/icu-design + icu-design@lists.sourceforge.net + http://sourceforge.net/mailarchive/forum.php?forum_name=icu-design + + + + + scm:git:git://github.com/unicode-org/icu.git + scm:git:git@github.com:unicode-org/icu.git + https://github.com/unicode-org/icu + + + + JIRA + https://unicode-org.atlassian.net/projects/ICU + + + + + icu4j-releases + ICU4J Central Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + icu4j-snapshots + ICU4J Central Development Repository + https://oss.sonatype.org/content/repositories/snapshots + + + + + + 73.1-SNAPSHOT + + + 1.8 + + 1.8 + + UTF-8 + + + 1.8 + + 1.8 + + UTF-8 + + + International Components for Unicode for Java + + 73 + + Unicode, Inc. + + + International Components for Unicode for Java + + ${icu4j.version} + + Unicode, Inc. + + org.unicode + + + 2 + + ${project.name} + + ${project.name} + + ${project.groupId} + + ${project.version} + + Unicode, Inc. + + © 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html + + + com.ibm.icu.util.VersionInfo + + + + + + + maven-icu4j + maven-icu4j-datafiles + maven-icu4j-charset + maven-icu4j-localespi + maven-icu4j-test-datafiles + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + + maven-surefire-plugin + 2.22.2 + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.3.0 + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M7 + + + + maven-remote-resources-plugin + 3.0.0 + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + + + + + + + + + junit + junit + 4.12 + test + + + + + pl.pragmatists + JUnitParams + 1.0.5 + test + + + + com.ibm.icu + icu4j-datafiles + ${icu4j.version} + + + + com.ibm.icu + icu4j-test-datafiles + ${icu4j.version} + provided + + + + com.ibm.icu + icu4j + ${icu4j.version} + + + + com.ibm.icu + icudata + ${icu4j.version} + + + + com.ibm.icu + icutzdata + ${icu4j.version} + + + + com.ibm.icu + testdata + ${icu4j.version} + + + + + + -- 2.40.0