ICU-22324 Small fixes for script moving folders to maven structure
- Symlinks to LICENSE, so that it is included in the .jar files
- Fixed version in the jar manifests (s/73/74/)
- Added Main-Class, Export-Package, some *-Title and *-Description
At this point the .jar files (including manifests) produced by ant / maven
are byte to byte identical, except for some small differences that are
expected and can be explained (will cover them in the email to the team)
diff --git a/icu4j/maven-migration/README_MAVEN.md b/icu4j/maven-migration/README_MAVEN.md
index 2adf4d1..9023b3e 100644
--- a/icu4j/maven-migration/README_MAVEN.md
+++ b/icu4j/maven-migration/README_MAVEN.md
@@ -20,7 +20,7 @@
Probably modify the step that produces the .jar files (in the C/C++ world)
- done: The tests for localespi should become integration tests
- We might want some integration tests to begin with
-- `LICENSE`, `security.policy`, anything else from `main/shared/` => LICENSE should be symlink.
+- done: `LICENSE`, `security.policy`, anything else from `main/shared/` => LICENSE should be symlink.
- done: The `.lst` files. All tests pass without, we can probably delete them. But need more testing.
If not, we need a way to generate them (right now I've copied them by hand)
- Double-check dependencies.
diff --git a/icu4j/maven-migration/main/charset/pom.xml b/icu4j/maven-migration/main/charset/pom.xml
index 9280007..630350a 100644
--- a/icu4j/maven-migration/main/charset/pom.xml
+++ b/icu4j/maven-migration/main/charset/pom.xml
@@ -15,7 +15,8 @@
<properties>
<icu4j.api.doc.root.dir>${project.basedir}/../..</icu4j.api.doc.root.dir>
- <mf.Automatic-Module-Name>com.ibm.icu.charset</mf.Automatic-Module-Name>
+ <module-name>charset</module-name>
+ <proj.displayname>charset</proj.displayname>
</properties>
<dependencies>
@@ -55,4 +56,19 @@
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Export-Package>com.ibm.icu.charset</Export-Package>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
diff --git a/icu4j/maven-migration/main/core/pom.xml b/icu4j/maven-migration/main/core/pom.xml
index 8492055..69db25d 100644
--- a/icu4j/maven-migration/main/core/pom.xml
+++ b/icu4j/maven-migration/main/core/pom.xml
@@ -53,6 +53,16 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Main-Class>com.ibm.icu.util.VersionInfo</Main-Class>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/icu4j/maven-migration/main/framework/pom.xml b/icu4j/maven-migration/main/framework/pom.xml
index e3eec4f..aee519f 100644
--- a/icu4j/maven-migration/main/framework/pom.xml
+++ b/icu4j/maven-migration/main/framework/pom.xml
@@ -39,7 +39,18 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Main-Class>com.ibm.icu.dev.test.TestAll</Main-Class>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
+
</project>
diff --git a/icu4j/maven-migration/main/icu4j/pom.xml b/icu4j/maven-migration/main/icu4j/pom.xml
index 461d8a5..c01d56d 100644
--- a/icu4j/maven-migration/main/icu4j/pom.xml
+++ b/icu4j/maven-migration/main/icu4j/pom.xml
@@ -16,6 +16,14 @@
<properties>
<icu4j.api.doc.root.dir>${project.basedir}/../..</icu4j.api.doc.root.dir>
+
+ <mf.Automatic-Module-Name>com.ibm.icu</mf.Automatic-Module-Name>
+ <mf.Bundle-SymbolicName>com.ibm.icu</mf.Bundle-SymbolicName>
+ <mf.Bundle-Name>ICU4J</mf.Bundle-Name>
+ <localTitle>International Components for Unicode for Java</localTitle>
+ <mf.Bundle-Description>${localTitle}</mf.Bundle-Description>
+ <mf.Implementation-Title>${localTitle}</mf.Implementation-Title>
+ <mf.Specification-Title>${localTitle}</mf.Specification-Title>
</properties>
<dependencies>
@@ -71,6 +79,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Main-Class>com.ibm.icu.util.VersionInfo</Main-Class>
+ <Export-Package>com.ibm.icu.lang,com.ibm.icu.math,com.ibm.icu.number,com.ibm.icu.text,com.ibm.icu.util</Export-Package>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/icu4j/maven-migration/pom.xml b/icu4j/maven-migration/pom.xml
index 7c68b12..e3bf992 100644
--- a/icu4j/maven-migration/pom.xml
+++ b/icu4j/maven-migration/pom.xml
@@ -39,34 +39,40 @@
<proj-title>International Components for Unicode for Java</proj-title>
<proj.displayname>${project.artifactId}</proj.displayname>
- <mf.Manifest-Version>1.0</mf.Manifest-Version>
- <mf.Specification-Title>${proj-title} (${proj.displayname})</mf.Specification-Title>
- <mf.Implementation-Title>${proj-title} (${proj.displayname})</mf.Implementation-Title>
- <mf.Bundle-Description>${proj-title} (${proj.displayname})</mf.Bundle-Description>
- <mf.Automatic-Module-Name>com.ibm.icu.${project.artifactId}</mf.Automatic-Module-Name>
-
- <api.doc.version>73 Release Candidate</api.doc.version>
<!-- Variables used to generate the javadoc -->
+ <api.doc.version>74 Release Candidate</api.doc.version>
<icu4j.api.doc.window.title>ICU4J ${api.doc.version}</icu4j.api.doc.window.title>
<icu4j.api.doc.header>ICU4J ${api.doc.version}</icu4j.api.doc.header>
<icu4j.api.doc.copyright.footer><font size=-1>Copyright © 2016 Unicode, Inc. and others.</font></icu4j.api.doc.copyright.footer>
<!-- Needs to be overriden in sub-modules -->
<icu4j.api.doc.root.dir>${project.basedir}</icu4j.api.doc.root.dir>
- <mf.Specification-Version>73</mf.Specification-Version>
- <mf.Implementation-Version>73.0.1</mf.Implementation-Version>
- <mf.Bundle-Version>73.0.1</mf.Bundle-Version>
+ <!-- Used for the .jar Manifest files -->
+
+ <mf.Specification-Version>74</mf.Specification-Version>
+ <mf.Implementation-Version>74.0.1</mf.Implementation-Version>
+ <mf.Bundle-Version>74.0.1</mf.Bundle-Version>
+
+ <mf.Bundle-RequiredExecutionEnvironment>JavaSE-1.8</mf.Bundle-RequiredExecutionEnvironment>
+
+ <!-- For most modules artifactId does not have an "icu4j" prefix, so this is a good default -->
+ <module-name>${project.artifactId}</module-name>
+
+ <!-- Manifest fields that rarely change, if ever -->
+ <mf.Specification-Title>${proj-title} (${proj.displayname})</mf.Specification-Title>
+ <mf.Implementation-Title>${proj-title} (${proj.displayname})</mf.Implementation-Title>
+ <mf.Bundle-Description>${proj-title} (${proj.displayname})</mf.Bundle-Description>
+ <mf.Bundle-SymbolicName>com.ibm.icu.${module-name}</mf.Bundle-SymbolicName>
+ <mf.Automatic-Module-Name>com.ibm.icu.${module-name}</mf.Automatic-Module-Name>
+ <mf.Bundle-Name>ICU4J ${proj.displayname}</mf.Bundle-Name>
<mf.Specification-Vendor>Unicode, Inc.</mf.Specification-Vendor>
<mf.Implementation-Vendor>Unicode, Inc.</mf.Implementation-Vendor>
<mf.Bundle-Vendor>Unicode, Inc.</mf.Bundle-Vendor>
<mf.Implementation-Vendor-Id>org.unicode</mf.Implementation-Vendor-Id>
+ <mf.Manifest-Version>1.0</mf.Manifest-Version>
<mf.Bundle-ManifestVersion>2</mf.Bundle-ManifestVersion>
- <mf.Bundle-Name>ICU4J ${proj.displayname}</mf.Bundle-Name>
-
- <mf.Automatic-Module-Name>com.ibm.icu.${project.artifactId}</mf.Automatic-Module-Name>
<mf.Bundle-Copyright>© 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html</mf.Bundle-Copyright>
- <mf.Bundle-RequiredExecutionEnvironment>JavaSE-1.8</mf.Bundle-RequiredExecutionEnvironment>
</properties>
<build>
diff --git a/icu4j/maven-migration/toMaven.sh b/icu4j/maven-migration/toMaven.sh
index 2008871..0611f65 100755
--- a/icu4j/maven-migration/toMaven.sh
+++ b/icu4j/maven-migration/toMaven.sh
@@ -148,11 +148,14 @@
echo "Migrating $1 to maven"
moveMainModuleToMaven $1 classes main
moveMainModuleToMaven $1 tests test
+ mkdir -p main/$MODULE_NAME/src/main/resources/
+ ln -s ../../../../../../LICENSE main/$MODULE_NAME/src/main/resources/LICENSE
}
function simpleModuleToMaven() {
# 1. $1: component name (core, charset, etc)
export MODULE_NAME=$1
+ export LICENSE_PATH=$2
echo "Migrating $MODULE_NAME to maven"
safeMoveDir com $MODULE_NAME/src $MODULE_NAME/src/main/java
@@ -160,6 +163,9 @@
removeEclipseProjectFiles $MODULE_NAME
+ mkdir -p $MODULE_NAME/src/main/resources/
+ ln -s $LICENSE_PATH $MODULE_NAME/src/main/resources/LICENSE
+
echo " Remove empty folders from '$MODULE_NAME'"
removeEmptyFolders $MODULE_NAME
}
@@ -231,15 +237,15 @@
# ===============================================================
# Here starts the real script execution
+if [ -f "main/core/pom.xml" ]; then
+ echo "ERROR: looks like the structure was already migrated to maven?"
+ exit
+fi
if [ ! -f "main/classes/core/build.xml" ]; then
echo "ERROR: the current folder when running this script should be <icu_root>/icu4j"
echo "It is currently $PWD."
exit
fi
-if [ -f "main/core/pom.xml" ]; then
- echo "ERROR: looks like the structure was already migrated to maven?"
- exit
-fi
MVN_MIG_DIR="$(dirname "${BASH_SOURCE[0]}")"
@@ -269,10 +275,10 @@
echo "===================================="
echo "==== Migrating the root modules ===="
echo "===================================="
-simpleModuleToMaven demos
-simpleModuleToMaven samples
-simpleModuleToMaven tools/build
-simpleModuleToMaven tools/misc
+simpleModuleToMaven demos ../../../../../LICENSE
+simpleModuleToMaven samples ../../../../../LICENSE
+simpleModuleToMaven tools/build ../../../../../../LICENSE
+simpleModuleToMaven tools/misc ../../../../../../LICENSE
echo "================================================================================="
echo "==== Moving core unit tests that depend on non-core (circular dependencies) ====="
diff --git a/icu4j/maven-migration/tools/misc/pom.xml b/icu4j/maven-migration/tools/misc/pom.xml
index 766ebca..913598b 100644
--- a/icu4j/maven-migration/tools/misc/pom.xml
+++ b/icu4j/maven-migration/tools/misc/pom.xml
@@ -31,4 +31,19 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Main-Class>com.ibm.icu.dev.tool.localeconverter.XLIFF2ICUConverter</Main-Class>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>