blob: 1076d96ccfef30dec41adfb92f300cc4f8867657 [file] [log] [blame]
<?xml version="1.0"?>
<!--
* © 2016 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*******************************************************************************
* Copyright (C) 2010-2016, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-root</artifactId>
<version>73.1-SNAPSHOT</version>
<!-- default relativePath for parent -->
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>73.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ICU4J</name>
<description>International Component for Unicode for Java (ICU4J) is a mature, widely used Java library providing Unicode and Globalization support</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<!-- add directories with main executable code -->
<execution>
<id>add-source</id>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>../../main/classes/collate/src</source>
<source>../../main/classes/core/src</source>
<source>../../main/classes/currdata/src</source>
<source>../../main/classes/langdata/src</source>
<source>../../main/classes/regiondata/src</source>
<source>../../main/classes/translit/src</source>
</sources>
</configuration>
</execution>
<!-- add directories with test code -->
<execution>
<id>add-test-source</id>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>../../main/tests/collate/src</source>
<source>../../main/tests/core/src</source>
<source>../../main/tests/framework/src</source>
<source>../../main/tests/packaging/src</source>
<source>../../main/tests/translit/src</source>
<source>../../tools/misc/src</source>
</sources>
</configuration>
</execution>
<!-- add directories with main executable resources -->
<execution>
<id>add-resource</id>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>../../main/classes/collate/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/classes/core/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/classes/currdata/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/classes/langdata/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/classes/regiondata/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/classes/translit/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
<!-- add directories with test resources -->
<execution>
<id>add-test-resource</id>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>../../main/tests/collate/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/tests/core/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/tests/framework/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/tests/packaging/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../main/tests/translit/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>../../tools/misc/src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!--
Extract the resource files from the icu4j-datafiles dependency so that it is available during `test`.
Note: The extraction here will not result in these files being included in the packaged jar.
-->
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<resourceBundles>
<resourceBundle>com.ibm.icu:icu4j-datafiles:${icu4j.version}</resourceBundle>
</resourceBundles>
</configuration>
</execution>
</executions>
</plugin>
<!--
Extract and unpack the *.res files from the *.jar files in the upstream depenendency `com.ibm.icu:icu4j-datafiles`.
Enables the creation of *.lst files in the next phase using the helper script.
Use the ./target/classes directory as the output directory so that the files (included generated *.lst files)
get included in the shaded .jar file.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.ibm.icu</includeGroupIds>
<!-- exclude test resource files which come through dependencies as `provided` scope -->
<excludeScope>provided</excludeScope>
<excludes>**/*.cnv,**/cnvalias.icu,**/*.jar</excludes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!--
Process and transform the resource files before they get packaged up in the .jar file.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<!--
Replicate the creation of fullLocaleNames.lst files in every subdirectory of the dir of copied data
that the Ant build.xml file encodes.
-->
<execution>
<id>full-locale-names</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./file-listing-helper.sh</executable>
</configuration>
</execution>
<!-- Copy the license file. -->
<execution>
<id>copy-license-file</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../../icu4c/LICENSE</argument>
<argument>${project.build.directory}/classes</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<!--
Enable configuration of the Manifest file, etc. during the process of packaging the .jar file.
For future reference: https://stackoverflow.com/questions/38548271/difference-between-maven-plugins-assembly-plugins-jar-plugins-shaded-plugi
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
<Specification-Title>${jar.spec.title}</Specification-Title>
<Specification-Version>${jar.spec.version}</Specification-Version>
<Specification-Vendor>${jar.spec.vendor}</Specification-Vendor>
<Implementation-Title>${jar.impl.title}</Implementation-Title>
<Implementation-Version>${jar.impl.version}</Implementation-Version>
<Implementation-Vendor>${jar.impl.vendor}</Implementation-Vendor>
<Implementation-Vendor-Id>${jar.impl.vendor.id}</Implementation-Vendor-Id>
<Bundle-ManifestVersion>${jar.manifest.version}</Bundle-ManifestVersion>
<Bundle-Name>${jar.name}</Bundle-Name>
<Bundle-Description>${jar.description}</Bundle-Description>
<Bundle-SymbolicName>${jar.symbolic.name}</Bundle-SymbolicName>
<Bundle-Version>${jar.version}</Bundle-Version>
<Bundle-Vendor>${jar.vendor}</Bundle-Vendor>
<Bundle-Copyright>${jar.copyright.info}</Bundle-Copyright>
<!-- TODO: We should remove this, right??? -->
<Main-Class>${jar.main.class}</Main-Class>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-datafiles</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-test-datafiles</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- this is for parameterized JUnit tests -->
<dependency>
<groupId>pl.pragmatists</groupId>
<artifactId>JUnitParams</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>