maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r774977 - in /maven/plugins/branches/maven-assembly-plugin-2.2-beta-4: ./ src/it/projects/basic-features/ExecutionRoot/ src/it/projects/basic-features/ExecutionRoot/child/ src/it/projects/basic-features/ExecutionRoot/src/ src/it/projects/ba...
Date Fri, 15 May 2009 01:11:54 GMT
Author: brianf
Date: Fri May 15 01:11:54 2009
New Revision: 774977

URL: http://svn.apache.org/viewvc?rev=774977&view=rev
Log:
MASSEMBLY-406 - add execution root flag

Added:
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/
      - copied from r773749, maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/
      - copied from r773749, maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
      - copied, changed from r773749, maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/invoker.properties
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/pom.xml
      - copied, changed from r773749, maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/src.xml
      - copied, changed from r773751, maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/file-sets/include-base-directory/src/main/assembly/src.xml
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/verify.bsh
      - copied, changed from r773751, maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/file-copyIntoTopDir/verify.bsh
Modified:
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/pom.xml
    maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java

Modified: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/pom.xml?rev=774977&r1=774976&r2=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/pom.xml (original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/pom.xml Fri May 15 01:11:54 2009
@@ -29,7 +29,7 @@
   </parent>
 
   <artifactId>maven-assembly-plugin</artifactId>
-  <version>2.2-beta-3</version>
+  <version>2.2-beta-4-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Maven Assembly Plugin</name>
@@ -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>

Copied: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
(from r773749, 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-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/pom.xml?p2=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/pom.xml&p1=maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml&r1=773749&r2=774977&rev=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
(original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/child/pom.xml
Fri May 15 01:11:54 2009
@@ -6,7 +6,7 @@
     <artifactId>parent</artifactId>
     <version>1.0</version>
   </parent>
-  
+  <name>Child</name>
   <groupId>org.test</groupId>
   <artifactId>child</artifactId>
   <version>1.0</version>

Added: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/invoker.properties?rev=774977&view=auto
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/invoker.properties
(added)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/invoker.properties
Fri May 15 01:11:54 2009
@@ -0,0 +1,2 @@
+invoker.goals=clean validate
+#invoker.mavenOpts=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

Copied: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/pom.xml
(from r773749, 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-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/pom.xml?p2=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/pom.xml&p1=maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml&r1=773749&r2=774977&rev=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-brian-asfrelease/src/it/projects/basic-features/ExecutionRoot/pom.xml
(original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/pom.xml
Fri May 15 01:11:54 2009
@@ -16,13 +16,6 @@
   <modules>
     <module>child</module>
   </modules>
-  <dependencies>
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>1.0.4</version>
-    </dependency>
-  </dependencies>
 
   <build>
     <plugins>
@@ -31,9 +24,9 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <configuration>
           <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
-          <descriptorRefs>
-            <descriptorRef>project</descriptorRef>
-          </descriptorRefs>
+          <descriptors>
+            <descriptor>src/assemble/src.xml</descriptor>
+          </descriptors>
         </configuration>
         <executions>
           <execution>

Copied: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/src.xml
(from r773751, maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/file-sets/include-base-directory/src/main/assembly/src.xml)
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/src.xml?p2=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/src.xml&p1=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/file-sets/include-base-directory/src/main/assembly/src.xml&r1=773751&r2=774977&rev=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/file-sets/include-base-directory/src/main/assembly/src.xml
(original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/src/assemble/src.xml
Fri May 15 01:11:54 2009
@@ -1,14 +1,14 @@
 <assembly>
   <id>src</id>
   <formats>
-    <format>dir</format>
+    <format>zip</format>
   </formats>
   <includeBaseDirectory>true</includeBaseDirectory>
   <fileSets>
     <fileSet>
-      <directory>src</directory>
+      <directory>/</directory>
       <excludes>
-        <exclude>**/.svn/**</exclude>
+        <exclude>**/*.log</exclude>
       </excludes>
     </fileSet>
   </fileSets>

Copied: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/verify.bsh
(from r773751, maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/file-copyIntoTopDir/verify.bsh)
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/verify.bsh?p2=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/verify.bsh&p1=maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/file-copyIntoTopDir/verify.bsh&r1=773751&r2=774977&rev=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/file-copyIntoTopDir/verify.bsh
(original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/it/projects/basic-features/ExecutionRoot/verify.bsh
Fri May 15 01:11:54 2009
@@ -6,7 +6,7 @@
 
 try
 {
-    result = new File( basedir, "target/parent-1.0-bug-example/TODO.txt" ).exists();   
+    result = new File( basedir, "target/parent-1.0-src.zip" ).exists() && !new File(
basedir, "child/target/child-1.0-src.zip" ).exists();   
 }
 catch( IOException e )
 {

Modified: maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java?rev=774977&r1=774976&r2=774977&view=diff
==============================================================================
--- maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
(original)
+++ maven/plugins/branches/maven-assembly-plugin-2.2-beta-4/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
Fri May 15 01:11:54 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