You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/10/21 17:21:15 UTC
svn commit: r1400666 - in /maven/plugins/trunk/maven-dependency-plugin: ./
src/it/setup-custom-ear-lifecycle/ src/it/setup-custom-ear-lifecycle/manager/
src/it/setup-custom-ear-lifecycle/manager/src/
src/it/setup-custom-ear-lifecycle/manager/src/main/ ...
Author: rfscholte
Date: Sun Oct 21 15:21:14 2012
New Revision: 1400666
URL: http://svn.apache.org/viewvc?rev=1400666&view=rev
Log:
[MDEP-300] Unpacking artifacts should be based on type, with fallback on file-extension.
Added:
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogArchiver.java
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogUnArchiver.java
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/components.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/EarMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/components.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/verify.groovy
Modified:
maven/plugins/trunk/maven-dependency-plugin/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/pom.xml?rev=1400666&r1=1400665&r2=1400666&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Sun Oct 21 15:21:14 2012
@@ -303,16 +303,9 @@ under the License.
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<debug>true</debug>
- <projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
- <pomIncludes>
- <pomInclude>*/pom.xml</pomInclude>
- </pomIncludes>
- <setupIncludes>
- <setupInclude>setup-custom-analyzer/pom.xml</setupInclude>
- </setupIncludes>
<preBuildHookScript>setup</preBuildHookScript>
- <postBuildHookScript>validate</postBuildHookScript>
+ <postBuildHookScript>verify</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<goals>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/invoker.properties?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/invoker.properties Sun Oct 21 15:21:14 2012
@@ -0,0 +1 @@
+invoker.goals = clean install
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/pom.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/pom.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,15 @@
+<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.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-manager</artifactId>
+ <version>1.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-archiver</artifactId>
+ <version>2.2</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogArchiver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogArchiver.java?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogArchiver.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogArchiver.java Sun Oct 21 15:21:14 2012
@@ -0,0 +1,31 @@
+package org.apache.maven.archiver;
+
+import java.io.IOException;
+
+import org.codehaus.plexus.archiver.AbstractArchiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+
+public class LogArchiver extends AbstractArchiver
+{
+ private String archiveType;
+
+ @Override
+ protected void execute()
+ throws ArchiverException, IOException
+ {
+ getLogger().info( "LogArchiver.execute()" );
+ }
+
+ @Override
+ protected void close()
+ throws IOException
+ {
+ getLogger().info( "LogArchiver.close()" );
+ }
+
+ @Override
+ protected String getArchiveType()
+ {
+ return archiveType;
+ }
+}
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogUnArchiver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogUnArchiver.java?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogUnArchiver.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/java/org/apache/maven/archiver/LogUnArchiver.java Sun Oct 21 15:21:14 2012
@@ -0,0 +1,26 @@
+package org.apache.maven.archiver;
+
+import java.io.File;
+
+import org.codehaus.plexus.archiver.AbstractUnArchiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+
+public class LogUnArchiver extends AbstractUnArchiver
+{
+
+ @Override
+ protected void execute()
+ throws ArchiverException
+ {
+ getLogger().info( "LogUnArchiver.execute()" );
+ }
+
+ @Override
+ protected void execute( String path, File outputDirectory )
+ throws ArchiverException
+ {
+ getLogger().info( "LogUnArchiver.execute( String path, File outputDirectory )" );
+ getLogger().info( " path = " + path );
+ getLogger().info( " outputDirectory = " + outputDirectory );
+ }
+}
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/components.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/manager/src/main/resources/META-INF/plexus/components.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,35 @@
+<?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.
+-->
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.archiver.Archiver</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.archiver.LogArchiver</implementation>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.archiver.UnArchiver</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.archiver.LogUnArchiver</implementation>
+ </component>
+ </components>
+</component-set>
+
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/pom.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/pom.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,67 @@
+<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.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-plugin</artifactId>
+ <version>1.0</version>
+ <packaging>maven-plugin</packaging>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>org.apache.maven.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-manager</artifactId>
+ <version>1.0</version>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-archiver</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <!-- dependencies to annotations -->
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/EarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/EarMojo.java?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/EarMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/java/org/apache/maven/plugins/EarMojo.java Sun Oct 21 15:21:14 2012
@@ -0,0 +1,47 @@
+package org.apache.maven.plugins;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+
+@Mojo( name="ear" )
+public class EarMojo extends AbstractMojo
+{
+ @Component
+ private MavenProject project;
+
+ /**
+ * Directory containing the generated EAR.
+ */
+ @Parameter( defaultValue = "${project.build.directory}", required=true )
+ private File outputDirectory;
+
+ /**
+ * Name of the generated EAR.
+ */
+ @Parameter( alias = "earName", property = "ear.finalName", defaultValue = "${project.build.finalName}", required = true )
+ private String finalName;
+
+ public void execute() throws MojoExecutionException
+ {
+ File targetFile = new File( outputDirectory, finalName + ".ear" );
+
+ try
+ {
+ targetFile.getParentFile().mkdirs();
+ targetFile.createNewFile();
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+
+ project.getArtifact().setFile( targetFile );
+ }
+}
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/components.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/plugin/src/main/resources/META-INF/plexus/components.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,73 @@
+<?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.
+-->
+<component-set>
+ <components>
+ <!--
+ | EAR
+ |-->
+ <component>
+ <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+ <configuration>
+ <type>custom-ear</type>
+ <extension>ear</extension>
+ <language>java</language>
+ </configuration>
+ </component>
+ <component>
+ <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+ <configuration>
+ <lifecycles>
+ <lifecycle>
+ <id>default</id>
+ <!-- START SNIPPET: ear-lifecycle -->
+ <phases>
+ <package>${project.groupId}:${project.artifactId}:${project.version}:ear</package>
+ <install>
+ org.apache.maven.plugins:maven-install-plugin:2.3.1:install
+ </install>
+ <deploy>
+ org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
+ </deploy>
+ </phases>
+ <!-- END SNIPPET: ear-lifecycle -->
+ </lifecycle>
+ </lifecycles>
+ </configuration>
+ </component>
+ <!-- MOVED TO MANAGER
+ <component>
+ <role>org.codehaus.plexus.archiver.Archiver</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.archiver.LogArchiver</implementation>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.archiver.UnArchiver</role>
+ <role-hint>custom-ear</role-hint>
+ <implementation>org.apache.maven.archiver.LogUnArchiver</implementation>
+ </component>
+ -->
+ </components>
+</component-set>
+
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/pom.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/setup-custom-ear-lifecycle/pom.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,13 @@
+<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.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>manager</module>
+ <module>plugin</module>
+ </modules>
+
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/invoker.properties?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/invoker.properties Sun Oct 21 15:21:14 2012
@@ -0,0 +1 @@
+invoker.goals = clean integration-test
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/pom.xml?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/pom.xml Sun Oct 21 15:21:14 2012
@@ -0,0 +1,83 @@
+<?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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>mdep-300</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>custom-ear</packaging>
+
+ <description>
+ Test dependency:unpack with custom packaging type
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <!--
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-manager</artifactId>
+ <version>1.0</version>
+ </extension>
+ </extensions>
+ -->
+ <plugins>
+ <plugin>
+ <extensions>true</extensions>
+ <groupId>org.apache.maven.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-plugin</artifactId>
+ <version>1.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>integration-test</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <type>${project.packaging}</type>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins.dependency.its</groupId>
+ <artifactId>maven-custom-ear-manager</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/verify.groovy?rev=1400666&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/verify.groovy (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-custom-ear/verify.groovy Sun Oct 21 15:21:14 2012
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+def buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+assert buildLog.text.contains( "[DEBUG] Found unArchiver by type: " )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?rev=1400666&r1=1400665&r2=1400666&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Sun Oct 21 15:21:14 2012
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.dependen
* under the License.
*/
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -196,10 +197,10 @@ public abstract class AbstractDependency
}
}
- protected void unpack( File file, File location )
+ protected void unpack( Artifact artifact, File location )
throws MojoExecutionException
{
- unpack( file, location, null, null );
+ unpack( artifact, location, null, null );
}
/**
@@ -212,9 +213,10 @@ public abstract class AbstractDependency
* @param excludes Comma separated list of file patterns to exclude i.e. <code>**/*.xml,
* **/*.properties</code>
*/
- protected void unpack( File file, File location, String includes, String excludes )
+ protected void unpack( Artifact artifact, File location, String includes, String excludes )
throws MojoExecutionException
{
+ File file = artifact.getFile();
try
{
logUnpack( file, location, includes, excludes );
@@ -230,7 +232,16 @@ public abstract class AbstractDependency
UnArchiver unArchiver;
- unArchiver = archiverManager.getUnArchiver( file );
+ try
+ {
+ unArchiver = archiverManager.getUnArchiver( artifact.getType() );
+ getLog().debug( "Found unArchiver by type: " + unArchiver );
+ }
+ catch ( NoSuchArchiverException e )
+ {
+ unArchiver = archiverManager.getUnArchiver( file );
+ getLog().debug( "Found unArchiver by extension: " + unArchiver );
+ }
unArchiver.setUseJvmChmod( useJvmChmod );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?rev=1400666&r1=1400665&r2=1400666&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Sun Oct 21 15:21:14 2012
@@ -88,7 +88,7 @@ public class UnpackDependenciesMojo
destDir = DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType,
useSubDirectoryPerArtifact, useRepositoryLayout,
stripVersion, outputDirectory, artifact );
- unpack( artifact.getFile(), destDir, getIncludes(), getExcludes() );
+ unpack( artifact, destDir, getIncludes(), getExcludes() );
DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( artifact, this.markersDirectory );
handler.setMarker();
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?rev=1400666&r1=1400665&r2=1400666&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java Sun Oct 21 15:21:14 2012
@@ -125,7 +125,7 @@ public final class UnpackMojo
{
MarkerHandler handler = new UnpackFileMarkerHandler( artifactItem, this.markersDirectory );
- unpack( artifactItem.getArtifact().getFile(), artifactItem.getOutputDirectory(), artifactItem.getIncludes(),
+ unpack( artifactItem.getArtifact(), artifactItem.getOutputDirectory(), artifactItem.getIncludes(),
artifactItem.getExcludes() );
handler.setMarker();
}