Configuring eclipse wtp facets on a java project

Hello,

I’m trying to use the eclipse plugin, but I’m blocked on a problem with the configuration. I tried both Gradle 2.0 and 2.1. I’d like to configure the facets for a java project, which is a dependency of a war project, but I get the following error: > Could not find method facet() for arguments [{name=someCoolFacet, version=1.3} ] on root project ‘TestWTP’

This is a minimum .gradle sample file:

subprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'eclipse-wtp'
}
  project(':WAR') {
 apply plugin: 'war'
 dependencies {
  compile project(':JAR')
 }
 // Works fine here
 eclipse.wtp.facet {
  facet name: 'someCoolFacet', version: '1.3'
 }
}
  project(':JAR') {
 // Here it breaks
 eclipse.wtp.facet {
  facet name: 'someCoolFacet', version: '1.3'
 }
}

Thanks for your help!