From e868c25b6317f9874afbac69814526f7e841edba Mon Sep 17 00:00:00 2001 From: seusher Date: Wed, 14 Dec 2016 16:41:44 -0800 Subject: [PATCH] getProjectModules: IllegalStateException In my project, we have multiple modules, some of which also contain other modules. When building one specific module (which itself had child modules) from the root pom file, the build would fail when maven-assembly-plugin threw an IllegalStateException, but building from the module's pom.xml file directly, the build succeeded. I narrowed this down to the candidateIterator being set to null after .remove() is called, and that iterator not being updated to the next item before using it as a candidate for other projects. --- .../org/apache/maven/plugins/assembly/utils/ProjectUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/utils/ProjectUtils.java b/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/utils/ProjectUtils.java index 242fc5074d..269b7793c4 100644 --- a/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/utils/ProjectUtils.java +++ b/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/utils/ProjectUtils.java @@ -130,6 +130,9 @@ public static Set getProjectModules( @Nonnull final MavenProject p // increment the change counter, to show that we // verified a new module on this pass. changed++; + + // We need to move on to the next candidate since this one was just verified + break; } } }