maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1299282 - in /maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105: ./ bundle/ bundle/src/ bundle/src/main/ bundle/src/main/java/ bundle/src/main/java/test/ shaded-jar/
Date Sat, 10 Mar 2012 22:10:59 GMT
Author: olamy
Date: Sat Mar 10 22:10:59 2012
New Revision: 1299282

URL: http://svn.apache.org/viewvc?rev=1299282&view=rev
Log:
[MSHADE-105] Classes processed by the relocator still have references to the original classes
in their constant pools.
Add integration test.
Submitted by Andreas Veithen.

Added:
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml   (with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
  (with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml   (with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml   (with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh   (with props)

Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml?rev=1299282&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml Sat Mar 10 22:10:59
2012
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.its.shade.mr</groupId>
+    <artifactId>MSHADE-105-ROOT</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>MSHADE-105-BUNDLE</artifactId>
+
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>MSHADE-105-SHADED-JAR</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.1.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Embed-Dependency>*</Embed-Dependency>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java?rev=1299282&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
(added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
Sat Mar 10 22:10:59 2012
@@ -0,0 +1,12 @@
+package test;
+
+import internal.io.IOUtils;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class Dummy {
+    public static void dump(InputStream in) throws IOException {
+        IOUtils.copy(in, System.out);
+    }
+}

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/bundle/src/main/java/test/Dummy.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml?rev=1299282&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml Sat Mar 10 22:10:59 2012
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.shade.mr</groupId>
+  <artifactId>MSHADE-105-ROOT</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>shaded-jar</module>
+    <module>bundle</module>
+  </modules>
+
+</project>

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml?rev=1299282&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml Sat Mar 10
22:10:59 2012
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.its.shade.mr</groupId>
+    <artifactId>MSHADE-105-ROOT</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>MSHADE-105-SHADED-JAR</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.4</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <relocations>
+                <relocation>
+                  <pattern>org.apache.commons.io</pattern>
+                  <shadedPattern>internal.io</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/shaded-jar/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh?rev=1299282&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh Sat Mar 10 22:10:59
2012
@@ -0,0 +1,19 @@
+import java.io.*;
+import java.util.jar.*;
+import java.util.*;
+
+JarFile jarFile = new JarFile( new File( basedir, "bundle/target/MSHADE-105-BUNDLE-1.0-SNAPSHOT.jar"
) );
+
+Manifest mf = jarFile.getManifest();
+jarFile.close();
+
+String importPackage = mf.getMainAttributes().getValue( "Import-Package" );
+System.out.println("importPackage:"+importPackage);
+
+if ( importPackage.indexOf("org.apache.commons.io" ) >=0 )
+{
+    throw new IllegalStateException( "MANIFEST.MF has Import-Package entry with org.apache.commons.io"
);
+}
+
+
+return true;

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-105/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message