ProjectAdapter project = new ProjectAdapter(bundleProject);
project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");
// configure java project with dependencies
MavenDependency slingApiDep = new MavenDependency().groupId("org.apache.sling")
.artifactId("org.apache.sling.api").version("2.2.0");
MavenDependency servletApiDep = new MavenDependency().groupId("javax.servlet").artifactId("servlet-api")
.version("2.4");
project.configureAsJavaProject(slingApiDep, servletApiDep);
// create DS component class
InputStream simpleServlet = getClass().getResourceAsStream("SimpleServlet.java.v1.txt");