You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by my...@apache.org on 2017/12/27 08:22:59 UTC

incubator-hivemall git commit: [HIVEMALL-164] Fixed pom for appending proper NOTICE/LICENSE/DISCLAIMER to jars

Repository: incubator-hivemall
Updated Branches:
  refs/heads/master b814d9661 -> 2a7525311


[HIVEMALL-164] Fixed pom for appending proper NOTICE/LICENSE/DISCLAIMER 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 <my...@apache.org>

Closes #129 from myui/HIVEMALL-164.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/2a752531
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/2a752531
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/2a752531

Branch: refs/heads/master
Commit: 2a7525311556368d1974f80e1fc2ff7da9c3f881
Parents: b814d96
Author: Akira Ajisaka <aa...@apache.org>
Authored: Wed Dec 27 17:22:44 2017 +0900
Committer: Makoto Yui <my...@apache.org>
Committed: Wed Dec 27 17:22:44 2017 +0900

----------------------------------------------------------------------
 core/pom.xml    | 14 ++++++++++++++
 mixserv/pom.xml |  7 +++++++
 nlp/pom.xml     |  9 +++++++++
 pom.xml         | 53 +++++++++++++++++++++++++++++++++-------------------
 xgboost/pom.xml | 17 +++++++++++++++++
 5 files changed, 81 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/2a752531/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 65e1ec7..c79124a 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -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>

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/2a752531/mixserv/pom.xml
----------------------------------------------------------------------
diff --git a/mixserv/pom.xml b/mixserv/pom.xml
index be60577..0a1b387 100644
--- a/mixserv/pom.xml
+++ b/mixserv/pom.xml
@@ -178,6 +178,13 @@
 								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>
 										<include>**</include>

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/2a752531/nlp/pom.xml
----------------------------------------------------------------------
diff --git a/nlp/pom.xml b/nlp/pom.xml
index 80f9e37..dc77c06 100644
--- a/nlp/pom.xml
+++ b/nlp/pom.xml
@@ -184,6 +184,12 @@
 							</artifactSet>
 							<filters>
 								<filter>
+									<artifact>*:*</artifact>
+									<excludes>
+										<exclude>META-INF/LICENSE.txt</exclude>
+									</excludes>
+								</filter>
+								<filter>
 									<artifact>org.apache.lucene:lucene-analyzers-kuromoji</artifact>
 									<includes>
 										<include>**</include>
@@ -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>

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/2a752531/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 41fac52..82eb6e4 100644
--- a/pom.xml
+++ b/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>
 

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/2a752531/xgboost/pom.xml
----------------------------------------------------------------------
diff --git a/xgboost/pom.xml b/xgboost/pom.xml
index 82cc306..b9f11b8 100644
--- a/xgboost/pom.xml
+++ b/xgboost/pom.xml
@@ -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>