Skip to content
Permalink
Browse files
[HIVEMALL-164] Fixed pom for appending proper NOTICE/LICENSE/DISCLAIM…
…ER to jars

## What changes were proposed in this pull request?

Fixed pom for appending proper NOTICE/LICENSE/DISCLAIMER to jars. `maven-remote-resources-plugin` used in parent Apache pom does not work well.

This PR closes #128

## What type of PR is it?

Improvement

## What is the Jira issue?

https://issues.apache.org/jira/browse/HIVEMALL-164

## How was this patch tested?

manual tests

## How to use this feature?

`./bin/build.sh`

Author: Makoto Yui <myui@apache.org>

Closes #129 from myui/HIVEMALL-164.
  • Loading branch information
aajisaka authored and myui committed Dec 27, 2017
1 parent b814d96 commit 2a7525311556368d1974f80e1fc2ff7da9c3f881
Showing 5 changed files with 81 additions and 19 deletions.
@@ -238,7 +238,21 @@
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
</manifestEntries>
</transformer>
<!--
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformer>
-->
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -177,6 +177,13 @@
commons-logging invokes log4j through Java reflection. 'filers' clauses avoid
this issue as described in the URL below http://stackoverflow.com/questions/8817257/minimize-an-uber-jar-correctly-using-shade-plugin -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
</excludes>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
@@ -183,6 +183,12 @@
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/LICENSE.txt</exclude>
</excludes>
</filter>
<filter>
<artifact>org.apache.lucene:lucene-analyzers-kuromoji</artifact>
<includes>
@@ -217,6 +223,9 @@
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformer>
</transformers>
</configuration>
</execution>
53 pom.xml
@@ -522,6 +522,40 @@
</execution>
</executions>
</plugin>
<!-- Copy LICENSE/NOTICE/DISCLAIMER to jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/classes/META-INF</outputDirectory>
<resources>
<resource>
<directory>${main.basedir}/</directory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
<include>DISCLAIMER</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

@@ -691,25 +725,6 @@
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<resourceBundles>
<!-- Will generate META-INF/DEPENDENCIES META-INF/LICENSE META-INF/NOTICE -->
<resourceBundle>org.apache.apache.resources:apache-jar-resource-bundle:1.5-SNAPSHOT</resourceBundle>
<!-- Will generate META-INF/DISCLAIMER -->
<resourceBundle>org.apache.apache.resources:apache-incubator-disclaimer-resource-bundle:1.2-SNAPSHOT</resourceBundle>
</resourceBundles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

@@ -168,6 +168,14 @@
<include>ml.dmlc:xgboost4j</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tracker.py</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
<!-- hivemall-xgboost_xx-xx-with-dependencies.jar including minimum dependencies -->
@@ -194,6 +202,15 @@
<include>com.esotericsoftware.kryo:kryo</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>*.jar</exclude>
<exclude>tracker.py</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>

0 comments on commit 2a75253

Please sign in to comment.