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

// START SNIPPET project-before-configured
eclipseProject {
    beforeConfigured { project ->
        project.natures.clear()
    }
}
// END SNIPPET project-before-configured

// START SNIPPET wtp-with-xml
eclipseWtpFacet {
    withXml { provider ->
        provider.asNode().fixed.find { it.@facet == 'jst.java' }.@facet = 'jst2.java'
    }
}
// END SNIPPET wtp-with-xml
