IFacetedProject facetedProject = ProjectFacetsManager.create(project, true, monitor);
if(!facetedProject.hasProjectFacet(WTPProjectsUtil.EAR_FACET)) {
return;
}
IVirtualComponent earComponent = ComponentCore.createComponent(project);
Set<IVirtualReference> newRefs = new LinkedHashSet<IVirtualReference>();
EarPluginConfiguration config = new EarPluginConfiguration(mavenProject);
// Retrieving all ear module configuration from maven-ear-plugin : User defined modules + artifacts dependencies.
Set<EarModule> earModules = config.getEarModules();
String libBundleDir = config.getDefaultBundleDirectory();
updateLibDir(project, libBundleDir, monitor);
IPackagingConfiguration packagingConfig = new PackagingConfiguration(config.getPackagingIncludes(), config.getPackagingExcludes());
for(EarModule earModule : earModules) {
Artifact artifact = earModule.getArtifact();
IVirtualComponent depComponent = null;
IMavenProjectFacade workspaceDependency = projectManager.getMavenProject(artifact.getGroupId(), artifact
.getArtifactId(), artifact.getVersion());
if(workspaceDependency != null && !workspaceDependency.getProject().equals(project)
&& workspaceDependency.getFullPath(artifact.getFile()) != null) {