EclipseWtp’s component block seems to be broken. According to the DSL for EclipseWtpComponent, the following build script should add a wb-resource element and a wb-property element to the generated org.eclipse.wst.common.component file.
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
eclipse {
wtp {
component {
property name: 'moodOfTheDay', value: ':-D'
resource sourcePath: 'extra/resource', deployPath: 'deployment/resource'
}
}
}
Unfortunately, neither element (with the specified attributes) appear in the file. I can add a new element with the following build script.
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
eclipse {
wtp {
component {
file {
withXml {
def node = it.asNode( )
node.appendNode('xml', 'is what I love')
}
}
}
}
}
The only problem is that the new element appears after the wb-module end tag. I need to replace the child nodes of the wb-module element in the org.eclipse.wst.common.component file.