views:

11

answers:

0

I am trying to convert a java project to a dynamic web project programmatically by adding the required project facets.

Here is my code:

IProjectFacet JAVA_FACET    = ProjectFacetsManager.getProjectFacet("jst.java");
IProjectFacet WEB_FACET     = ProjectFacetsManager.getProjectFacet("jst.web");

iFacetedProject.installProjectFacet(JAVA_FACET.getVersion("5.0"), null, monitor);
iFacetedProject.installProjectFacet(WEB_FACET.getVersion("2.4"), null, monitor);

The facets get added correctly and the IDE recognizes the project as a web project. The problem I am seeing is that adding the facets also creates an EAR project which I don't want.

Is there a way to suppress creating an EAR and just adding the facets to my project?