[ https://jira.codehaus.org/browse/MWAR-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=300832#comment-300832 ]
Thomas Broyer commented on MWAR-269: ------------------------------------ Ah, you're right. The issue seems to actually be that the war plugin doesn't support artifacts coming from the reactor, when they haven't been packaged, when using Maven 3. To reproduce outside Eclipse: have a module B with packaging=war depends on a module A with packaging=jar; configure the war plugin to execute {{war:exploded}} in the {{prepare-package}} phase, then run {{mvn prepare-package}} at the reactor level. Building project B will fail when it'll try to copy project A, because it expects a packaged JAR, but the JAR wasn't created as the {{package}} phase wasn't executed, so Maven 3 gives the {{project.build.outputDirectory}} ({{target/classes}}) instead. FYI, the Tomcat plugin has a special step using {{MavenProject#getCompileClasspathElements}} (the war plugin could use {{getRuntimeClasspathElements}}) and then only {{getDependencies}} (where the war plugin uses {{getArtifacts}}), skipping those that are part of {{getProjectReferences}}. I'm afraid it would require an important refactoring of the war plugin though. See https://github.com/apache/tomcat-maven-plugin/blob/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java > war fails to build while using m2e in workspace resolution mode > --------------------------------------------------------------- > > Key: MWAR-269 > URL: https://jira.codehaus.org/browse/MWAR-269 > Project: Maven 2.x WAR Plugin > Issue Type: Improvement > Affects Versions: 2.1.1 > Reporter: Chris Gamache > Attachments: maven-war-plugin.patch, screenshot-1.png > > > This is my first time for an issue/patch submission. Apologies if I'm doing > it wrong.... > When building in Eclipse using m2e in workspace resolution mode, the > maven-war-plugin is not prepared for a "dependency" which isn't an assembly > but is instead a folder containing the compiled classes from within the local > workspace. I propose that if the incoming dependency happens to be a > directory that it get packaged up and copied to the destination instead of > blowing up with an exception. > See attached patch for your review... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira