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

// START SNIPPET project-before-merged
eclipse.project.file.beforeMerged { project ->
    project.natures.clear()
}
// END SNIPPET project-before-merged

// START SNIPPET 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 SNIPPET wtp-with-xml