maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r773749 - in /maven/plugins/branches/maven-assembly-plugin-brian-asfrelease: ./ src/it/projects/basic-features/ExecutionRoot/ src/it/projects/basic-features/ExecutionRoot/child/ src/main/java/org/apache/maven/plugin/assembly/mojos/
Date Tue, 12 May 2009 01:04:57 GMT
Author: brianf
Date: Tue May 12 01:04:56 2009
New Revision: 773749

URL: http://svn.apache.org/viewvc?rev=773749&view=rev
Log:
parking changes to be applied to beta-3

Added:
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/goals.txt
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
Modified:
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/pom.xml
    maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java

Modified: maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/pom.xml?rev=773749&r1=773748&r2=773749&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/pom.xml (original)
+++ maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/pom.xml Tue May 12 01:04:56
2009
@@ -304,7 +304,7 @@
       <pluginRepositories>
         <pluginRepository>
           <id>apache.snapshots</id>
-          <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+          <url>http://repository.apache.org/snapshots</url>
           <releases>
             <enabled>false</enabled>
           </releases>
@@ -315,8 +315,8 @@
         <invokerPluginVersion>1.3</invokerPluginVersion>
         <localRepositoryPath>${project.build.directory}/local-repository</localRepositoryPath>
         <test.remote.repo.url>file://${project.build.testOutputDirectory}/remote-repository</test.remote.repo.url>
-        <it.pomIncludes>**/pom.xml</it.pomIncludes>
-        <it.streamLogs>false</it.streamLogs>
+        <it.pomIncludes>**/basic-features/ExecutionRoot/**/pom.xml</it.pomIncludes>
+        <it.streamLogs>true</it.streamLogs>
         <testVersion>${pom.version}</testVersion>
       </properties>
 

Added: maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml?rev=773749&view=auto
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
(added)
+++ maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
Tue May 12 01:04:56 2009
@@ -0,0 +1,13 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.test</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+  </parent>
+  
+  <groupId>org.test</groupId>
+  <artifactId>child</artifactId>
+  <version>1.0</version>
+</project>

Added: maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/goals.txt?rev=773749&view=auto
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/goals.txt
(added)
+++ maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/goals.txt
Tue May 12 01:04:56 2009
@@ -0,0 +1 @@
+clean org.apache.maven.plugins:maven-assembly-plugin:${testVersion}:single

Added: maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml?rev=773749&view=auto
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
(added)
+++ maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
Tue May 12 01:04:56 2009
@@ -0,0 +1,49 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.plugin.assembly.test</groupId>
+    <artifactId>it-project-parent</artifactId>
+    <version>1</version>
+  </parent>
+  
+  <groupId>org.test</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+  
+  <name>Parent</name>
+  <modules>
+    <module>child</module>
+  </modules>
+  <dependencies>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+          <descriptorRefs>
+            <descriptorRef>project</descriptorRef>
+          </descriptorRefs>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <phase>validate</phase>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Modified: maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java?rev=773749&r1=773748&r2=773749&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
(original)
+++ maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
Tue May 12 01:04:56 2009
@@ -34,6 +34,7 @@
 import org.apache.maven.plugin.assembly.io.AssemblyReader;
 import org.apache.maven.plugin.assembly.model.Assembly;
 import org.apache.maven.plugin.assembly.utils.AssemblyFormatUtils;
+import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
@@ -306,6 +307,14 @@
      * @since 2.2-beta-3
      */
     private PlexusConfiguration archiverConfig;
+    
+    /**
+     * This will cause the assembly to run only at the top of a given module tree. That is,
run in the project 
+     * contained in the same folder where the mvn execution was launched.
+     * @parameter expression="${runOnlyAtExecutionRoot}" default-value="false"
+     * @since 2.2-beta-4
+     */
+    private boolean runOnlyAtExecutionRoot;
 
     /**
      * Create the binary distribution.
@@ -321,6 +330,13 @@
             getLog().info( "Assemblies have been skipped per configuration of the skipAssembly
parameter." );
             return;
         }
+        
+        //run only at the execution root.
+        if (runOnlyAtExecutionRoot && !isThisTheExecutionRoot())
+        {
+            getLog().info( "Skipping this project because it's not the Execution Root" );
+            return;
+        }
 
         List assemblies;
         try
@@ -416,6 +432,28 @@
         }
     }
 
+    /**
+     * Returns true if the current project is located at the Execution Root Directory (where
mvn was launched)
+     * @return
+     */
+    protected boolean isThisTheExecutionRoot()
+    {
+        Log log = this.getLog();
+        log.debug("Root Folder:" + mavenSession.getExecutionRootDirectory());
+        log.debug("Current Folder:"+ basedir );
+        boolean result = mavenSession.getExecutionRootDirectory().equalsIgnoreCase(basedir.toString());
+        if (result)
+        {
+            log.debug( "This is the execution root." );
+        }
+        else
+        {
+            log.debug( "This is NOT the execution root." );
+        }
+        
+        return result;
+    }
+    
     protected AssemblyArchiver getAssemblyArchiver()
     {
         return assemblyArchiver;



Mime
View raw message