configure(wtpModuleProjects()) { proj -> eclipseProject { natures.addAll( [ "org.eclipse.wst.common.modulecore.ModuleCoreNature" ]) } eclipseClasspath { withXml { xmlProvider -> def classpath = xmlProvider.asNode() def parser = new XmlParser() /* mark all runtime dependencies as WTP module dependencies. See, http://wiki.eclipse.org/ClasspathEntriesPublishExportSupport */ classpath.classpathentry.findAll{ entry -> entry.@kind == 'var' && configurations.runtime.find {entry.@path.endsWith(it.name)} }.each { entry -> def attrs = entry.attributes ?: parser.createNode(entry, 'attributes', [:]) parser.createNode(attrs, 'attribute', [name: 'org.eclipse.jst.component.dependency', value: '../']) } } } }