Author: jdcasey
Date: Wed May  3 21:36:02 2006
New Revision: 399542

URL: http://svn.apache.org/viewcvs?rev=399542&view=rev
Log:
Switching the processModules() method to fail if a module is included but has 
no associated artifact file. It looks like this might be related to the forked 
lifecycles, where a clone of the project instances are created...in which case, 
we may need a lifecycle overlay that will bridge the project artifact over for 
each one from executedProject to project when the package phase finished...see 
the CloverPlugin for a pseudo-example of this.

Modified:
    
maven/plugins/branches/MASSEMBLY-14/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java

Modified: 
maven/plugins/branches/MASSEMBLY-14/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/branches/MASSEMBLY-14/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java?rev=399542&r1=399541&r2=399542&view=diff
==============================================================================
--- 
maven/plugins/branches/MASSEMBLY-14/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
 (original)
+++ 
maven/plugins/branches/MASSEMBLY-14/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
 Wed May  3 21:36:02 2006
@@ -506,6 +506,8 @@
             }
 
             Set set = getModulesFromReactor( getExecutedProject() );
+            
+            getLog().debug( "Got modules: " + set );
 
             // TODO: includes and excludes
             for ( Iterator j = set.iterator(); j.hasNext(); )
@@ -513,9 +515,14 @@
                 MavenProject reactorProject = (MavenProject) j.next();
 
                 Artifact artifact = reactorProject.getArtifact();
-
-                if ( filter.include( artifact ) && artifact.getFile() != null )
+                
+                if ( filter.include( artifact ) )
                 {
+                    if ( artifact.getFile() == null )
+                    {
+                        throw new MojoExecutionException( "Module: " + 
reactorProject.getId() + " has not been built yet. It's artifact's file is 
null." );
+                    }
+                    
                     String name = artifact.getFile().getName();
 
                     if ( moduleSet.isUnpack() )


Reply via email to