Tested on Gradle 1.5 and Gradle 1.7
Consider this code block in a script:
eclipse {
wtp {
component {
resource deployPath: '/foobar', sourcePath: 'profiles/development/src/main/webapp'
println resources
}
}
}
According to documentation, a wb-resource element with sourcePath ‘profiles/development/src/main/webapp’ and deployPath ‘foobar’ should be added to the org.eclipse.wst.common.component.
Instead the result is this:
...
...
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/foobar" source-path="profiles/development/src/main/webapp"/>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/tavant-common/tavant-common">
<dependency-type>uses</dependency-type>
</dependent-module>
...
...
To get the documentation behavior one has to restate the default:
eclipse {
wtp {
component {
resource deployPath: '/foobar', sourcePath: 'profiles/development/src/main/webapp'
resource deployPath: '/', sourcePath: project.webAppDirName
}
}
}
Either this is a bug, or the documentation is wrong.
Note that this project is a child project in a multiproject build.