Skip to content

Commit

Permalink
ICU-22324 Mavenization, preparing for maven central deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mihnita committed Sep 22, 2023
1 parent c354427 commit 501fe1b
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 33 deletions.
2 changes: 2 additions & 0 deletions icu4j/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/release_cldr
**/dependency-reduced-pom.xml

8 changes: 7 additions & 1 deletion icu4j/main/charset/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>core</artifactId>
<artifactId>icu4j</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down Expand Up @@ -68,6 +68,12 @@
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
66 changes: 59 additions & 7 deletions icu4j/main/icu4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>source-jar</id>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createSourcesJar>true</createSourcesJar>
</configuration>
</execution>
<execution>
<goals>
<goal>shade</goal>
Expand All @@ -75,22 +84,65 @@
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<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>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
<include>**/dependency-reduced-pom.xml</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-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>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>with_javadoc</id>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- This is important. Since this is a shaded jar with no sources,
there is no javadoc generated without this line.
-->
<includeDependencySources>true</includeDependencySources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
1 change: 1 addition & 0 deletions icu4j/main/icu4j/src/main/resources/LICENSE
46 changes: 40 additions & 6 deletions icu4j/main/localespi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
</configuration>
</plugin>

<!--
<!--
Mainly for running localespi tests in Java 8:
The easiest way to get the integration tests to pass (in particular, to get the JVM that is
spawned with the `-Djava.ext.dirs` system property value to be interpreted properly in order
spawned with the `-Djava.ext.dirs` system property value to be interpreted properly in order
for the extensions jars therein to be loaded correctly) was to copy the jars needed to a
separate directory. (The alternative of pointing to the build directories of the respective
submodules didn't seem to work.)
Expand Down Expand Up @@ -142,15 +142,15 @@
<include>**/*ITCase.java</include>
</includes>

<!--
<!--
For Java 8:
Set up the locale service provider using the .jar file of `icu4j-localespi` main code from the `package` phase
Leave empty for Java 9+.
Using the `java.ext.dirs` special Java system property on Java 9+ runtimes triggers an
error that tells the user to place those jars on the classpath instead.
-->
<!--
<!--
Notes:
https://stackoverflow.com/a/5039973/2077918
Expand All @@ -169,7 +169,7 @@
-->
<argLine>${localespi-tests.jvm.args}</argLine>

<!--
<!--
For Java 9+:
Configure to use the locale service provider using the .jar file of `icu4j-localespi` main code from the `package` phase
Expand All @@ -183,11 +183,18 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>

</plugins>
</build>

<profiles>
<!--
<!--
For testing localespi using the Java extensions feature, which last existed in Java 8.
ICU4J currently has a minimum supported version of 8.
-->
Expand Down Expand Up @@ -215,6 +222,33 @@
<localespi-tests.locale-providers>CLDR,COMPAT,SPI</localespi-tests.locale-providers>
</properties>
</profile>
<profile>
<id>with_javadoc</id>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- All files in com/ibm/icu/impl folders are exluded from javadoc.
So we need to bring back this one file, to match the previously published artifacts.
Without this all java files are excluded and no javadoc is generated.
-->
<sourceFileIncludes>
<include>ICULocaleServiceProvider.java</include>
</sourceFileIncludes>
<sourcepath>${basedir}/src/main/java/com/ibm/icu/impl/javaspi</sourcepath>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

1 comment on commit 501fe1b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 501fe1b Previous: c354427 Ratio
TestCharsetDecoderICU 6.449068590462916 ns/iter 2.1518881924901367 ns/iter 3.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.