After upgrading to v2.5 I discovered that the output for our eclipse and eclipse-wtp project changed significantly. Some indication of the changes were mentioned in the release notes, mainly that the sub-project dependencies were no longer being set to exported, and instead the transitive dependencies would be directly applied to each project.
This change worked in Eclipse and all projects continued to compile correctly. However there was a negative impact to the assembly and deployment of our WARs with the eclipse-wtp output. The regression is caused by a few JAR projects that are dependencies of the WAR projects.
In the previous model, the JAR projects .classpath
would not export the dependencies in the WTP model:
<classpathentry kind="lib" path="/home/pcm/.gradle/caches/modules-2/files-2.1/axis/axis-wsdl4j/1.5.1/bd804633b9c2cf06258641febc31a8ff3b0906bc/axis-wsdl4j-1.5.1.jar" exported="true">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
In 2.5 the output changes to:
<classpathentry kind="lib" path="/home/pcm/.gradle/caches/modules-2/files-2.1/axis/axis-wsdl4j/1.5.1/bd804633b9c2cf06258641febc31a8ff3b0906bc/axis-wsdl4j-1.5.1.jar">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="../"/>
</attributes>
</classpathentry>
This breaks the WAR deployment because now all the dependencies of the JAR are deployed in the WEB-INF/lib
dir of the WAR. The previous method was correct because the required dependencies to deploy in the WEB-INF/lib
dir were correctly defined by the output of the .setttings/org.eclipse.wst.common.component
file in the WAR project.
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib//home/pcm/.gradle/caches/modules-2/files-2.1/axis/axis-wsdl4j/1.5.1/bd804633b9c2cf06258641febc31a8ff3b0906bc/axis-wsdl4j-1.5.1.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
So now in 2.5, there are duplicate dependencies added to the WAR.
There is a workaround to clear the WTP components from the JAR.
eclipse.wtp {
component.plusConfigurations.clear()
}
I think the old defaults were correct and should be reverted.