apply plugin: 'war'
apply plugin: 'eclipse'
eclipseClasspath {
    beforeConfigured { classpath ->
        classpath.entries.removeAll { entry -> entry.kind == 'lib' || entry.kind == 'var' }
    }
    whenConfigured { classpath ->
        classpath.entries.findAll { entry -> entry.kind == 'lib' }*.exported = false
    }
}

eclipseProject {
    beforeConfigured { project ->
        project.natures.clear()
    }
}

eclipseWtp {
    withXml { xml ->
        xml.'org.eclipse.wst.commons.project.facet.core'.fixed.find { it.@facet == 'jst.java' }.@facet = 'jst2.java'
    }
}
