Configuring wtp.component.resource in java project which is dependency of war project


(Denis Digtyar) #1

I have configuration like this settings.gradle

include 'java-project',
            'war-project'

build.gradle

subprojects {
  apply plugin: 'eclipse'
}
project(':war-project') {
  apply plugin: 'war'
  eclipse.wtp.component.contextPath = '/'
}
project(':java-project') {
  apply plugin: 'java'
  eclipse.wtp.component.resource sourcePath: '/META-INF', deployPath: '/META-INF' // <- gradle complains on this
}

How can I configure eclipse.wtp.component in java project at this level? Gradle complain that wtp property is not exists but eventually it gets configured as I see in eclipse project properties.


(Szczepan Faber) #2

Here’s the documentation on the eclipse wtp component configuration: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.eclipse.model.EclipseWtpComponent.html

I don’t see anything wrong with your build apart from missing the ‘eclipse-wtp’ plugin. At some point we split the eclipse WTP stuff into a separate plugin.

Perhaps you’re using some older version of Gradle that might have a slightly different api with regards to wtp components? For example, in milestone-3 the resources were configured as follows:

//milestone-3 (as far as I remember :)
eclipseWtpComponent.resource(sourcePath: '/META-INF', deployPath: '/META-INF')

Hope that helps!