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.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/branches/MASSEMBLY-14@399542 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java b/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
index 214d58c..3d7f8d6 100644
--- a/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
@@ -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() )