apply plugin: 'war'
// tag::use-eclipse-plugin[]
apply plugin: 'eclipse'
// end::use-eclipse-plugin[]
// tag::use-eclipse-wtp-plugin[]
apply plugin: 'eclipse-wtp'
// end::use-eclipse-wtp-plugin[]
// tag::module-before-merged[]
// tag::module-when-merged[]
eclipse.classpath.file {
// end::module-when-merged[]
    beforeMerged { classpath ->
        classpath.entries.removeAll { entry -> entry.kind == 'lib' || entry.kind == 'var' }
    }
// end::module-before-merged[]
// tag::module-when-merged[]
    whenMerged { classpath ->
        classpath.entries.findAll { entry -> entry.kind == 'lib' }*.exported = false
    }
// tag::module-before-merged[]
}
// end::module-before-merged[]
// end::module-when-merged[]

// tag::project-before-merged[]
eclipse.project.file.beforeMerged { project ->
    project.natures.clear()
}
// end::project-before-merged[]

// tag::wtp-with-xml[]
apply plugin: 'eclipse-wtp'

eclipse.wtp.facet.file.withXml { provider ->
    provider.asNode().fixed.find { it.@facet == 'jst.java' }.@facet = 'jst2.java'
}
// end::wtp-with-xml[]
