[ http://jira.codehaus.org/browse/MECLIPSE-76?page=comments#action_73044 ] mark struberg commented on MECLIPSE-76: ---------------------------------------
Let's spot the light onto this issue from another side: If an artifact is depending on a WAR, all resources are beeing unpacked and afterwards merged with the actual build results. For example if i'm building an artifact MY-B.war which has a dependency on MY-A.war, then MY-A.war is beeing unpacked and overlayed with the build results of MY-B.war by the maven-war-plugin. To get to the point: We end up with ONE single WAR file which has all classes in the same directory 'WEB-INF/classes' and with ALL jars in 'WEB-INF/lib'. This means that the produced classes from MY-B.war may access the classes from MY-A.war and also their jars. So why should we not set the classpath into the embedded classes and jars of the dependant WAR artifact? In my case, i have a product war artifact which is beeing used as baseline for multiple customisation war artifacts. This works perfectly for JSPs but not for java files. > Projects containing war's as dependency will not include war-reference > ---------------------------------------------------------------------- > > Key: MECLIPSE-76 > URL: http://jira.codehaus.org/browse/MECLIPSE-76 > Project: Maven 2.x Eclipse Plugin > Issue Type: Bug > Components: WTP support > Reporter: Tom Spengler > > if you have a dependency like > <dependency> > <groupId>j-core</groupId> > <artifactId>j-core-webapp-axx</artifactId> > <version>0.0.1</version> > <type>war</type> > </dependency> > it will not included int .classpath > Resolution could be > EclipseClasspathWriter > --old-- > Artifact artifact = (Artifact) it.next(); > if ( artifact.getArtifactHandler().isAddedToClasspath() ) > --new -- > Artifact artifact = (Artifact) it.next(); > if ( artifact.getArtifactHandler().isAddedToClasspath() > ||artifact.getArtifactHandler().isIncludesDependencies() ) > > and > EclipsePlugin.prepareArtifacts() > --old-- > Collection artifacts = project.getTestArtifacts(); > --new-- > Collection artifacts = project.getTestArtifacts(); > Set artifact_2 = project.getArtifacts(); > for (Iterator at = artifact_2.iterator(); at.hasNext();){ > Artifact arti = (Artifact) at.next(); > if (! artifacts.contains(arti)) > artifacts.add(arti); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira