Author: bentmann
Date: Mon Mar 23 08:45:37 2009
New Revision: 757350

URL: http://svn.apache.org/viewvc?rev=757350&view=rev
Log:
[MSHADE-46] Attached artifact has different type than main artifact

Added:
    maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
   (with props)
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
   (with props)
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml   
(with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml
   (with props)
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/
    
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
   (with props)
Modified:
    
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml?rev=757350&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
 Mon Mar 23 08:45:37 2009
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.shade.aat</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+  </parent>
+
+  <artifactId>consumer</artifactId>
+  <packaging>ear</packaging>
+
+  <name>MSHADE-46 :: Shaded Artifact Consumer</name>
+  <description>
+    Test that attached shaded artifacts have the same type as the original 
main artifact.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.shade.aat</groupId>
+      <artifactId>shade</artifactId>
+      <version>1.0</version>
+      <type>ejb</type>
+      <classifier>shaded</classifier>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <configuration>
+          <modules>
+            <!--
+            NOTE: In Maven 2.0.x, an artifact type mismatch will cause an 
early failure during dependency resolution.
+            In contrast, Maven 2.1.0 will successfully resolve the dependency 
from the reactor due to MNG-4056. However,
+            the resolved artifact will have the type as specified by its 
creator and the EAR Plugin will not accept a
+            "jar" for an EJB module.
+            -->
+            <ejbModule>
+              <groupId>org.apache.maven.its.shade.aat</groupId>
+              <artifactId>shade</artifactId>
+              <classifier>shaded</classifier>
+            </ejbModule>
+          </modules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/consumer/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties?rev=757350&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
 Mon Mar 23 08:45:37 2009
@@ -0,0 +1,2 @@
+# NOTE: Running only up to "package" is crucial, we want to check proper 
resolution from the reactor
+invoker.goals = clean package

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml?rev=757350&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml 
(added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml 
Mon Mar 23 08:45:37 2009
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.shade.aat</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <name>MSHADE-46</name>
+  <description>
+    Test that attached shaded artifacts have the same type as the original 
main artifact.
+  </description>
+
+  <modules>
+    <module>shade</module>
+    <module>consumer</module>
+  </modules>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.0.2</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-ear-plugin</artifactId>
+          <version>2.3.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-ejb-plugin</artifactId>
+          <version>2.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.3.1</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml?rev=757350&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml
 Mon Mar 23 08:45:37 2009
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.shade.aat</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+  </parent>
+
+  <artifactId>shade</artifactId>
+  <!-- NOTE: Using a type different than "jar" is the essential part of this 
test -->
+  <packaging>ejb</packaging>
+
+  <name>MSHADE-46 :: Shaded Artifact Producer</name>
+  <description>
+    Test that attached shaded artifacts have the same type as the original 
main artifact.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-shaded-artifact</id>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <shadedArtifactAttached>true</shadedArtifactAttached>
+              <shadedClassifierName>shaded</shadedClassifierName>
+              <createDependencyReducedPom>false</createDependencyReducedPom>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml?rev=757350&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
 Mon Mar 23 08:45:37 2009
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?>

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/attached-artifact-type/shade/src/main/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java?rev=757350&r1=757349&r2=757350&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
 Mon Mar 23 08:45:37 2009
@@ -368,7 +368,7 @@
             if ( shadedArtifactAttached )
             {
                 getLog().info( "Attaching shaded artifact." );
-                projectHelper.attachArtifact( project, "jar", 
shadedClassifierName, outputJar );
+                projectHelper.attachArtifact( project, 
project.getArtifact().getType(), shadedClassifierName, outputJar );
                 if ( createSourcesJar )
                 {
                     projectHelper.attachArtifact( project, "jar", 
shadedClassifierName + "-sources", sourcesJar );


Reply via email to