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

I have configuration like this settings.gradle

include 'java-project',


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.

Here’s the documentation on the eclipse wtp component configuration:

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!