466503 : Removed extraneous configurators

Change-Id: Iad65b189ba82861e166afc6a73199ccfd7b24654
Signed-off-by: Fred Bricon <fbricon@gmail.com>
diff --git a/org.eclipse.m2e.wtp.jsf/META-INF/MANIFEST.MF b/org.eclipse.m2e.wtp.jsf/META-INF/MANIFEST.MF
index 3a9ce2f..0cc6998 100644
--- a/org.eclipse.m2e.wtp.jsf/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.wtp.jsf/META-INF/MANIFEST.MF
@@ -12,8 +12,8 @@
  org.eclipse.jst.jsf.core;bundle-version="1.3.4",
  org.eclipse.core.resources,
  org.eclipse.emf.common,
- org.eclipse.m2e.core,
- org.eclipse.m2e.maven.runtime,
+ org.eclipse.m2e.core;bundle-version="[1.6.0,2.0.0)",
+ org.eclipse.m2e.maven.runtime;bundle-version="[1.6.0,2.0.0)",
  org.eclipse.wst.common.frameworks,
  org.eclipse.wst.common.project.facet.core,
  org.eclipse.jst.common.project.facet.core,
diff --git a/org.eclipse.m2e.wtp/META-INF/MANIFEST.MF b/org.eclipse.m2e.wtp/META-INF/MANIFEST.MF
index 0ad303e..103ffbd 100644
--- a/org.eclipse.m2e.wtp/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.wtp/META-INF/MANIFEST.MF
@@ -20,9 +20,9 @@
  org.eclipse.wst.common.frameworks,
  org.eclipse.wst.common.modulecore;visibility:=reexport,
  org.eclipse.wst.common.project.facet.core,
- org.eclipse.m2e.maven.runtime;bundle-version="[1.5,2.0)",
- org.eclipse.m2e.core;bundle-version="[1.5,2.0)",
- org.eclipse.m2e.jdt;bundle-version="[1.5,2.0)",
+ org.eclipse.m2e.maven.runtime;bundle-version="[1.6.0,2.0.0)",
+ org.eclipse.m2e.core;bundle-version="[1.6.0,2.0.0)",
+ org.eclipse.m2e.jdt;bundle-version="[1.6.0,2.0.0)",
  org.eclipse.ui.console,
  org.eclipse.emf.ecore,
  org.eclipse.jem.util,
diff --git a/org.eclipse.m2e.wtp/lifecycle-mapping-metadata.xml b/org.eclipse.m2e.wtp/lifecycle-mapping-metadata.xml
index 1ed4dbd..50834bd 100644
--- a/org.eclipse.m2e.wtp/lifecycle-mapping-metadata.xml
+++ b/org.eclipse.m2e.wtp/lifecycle-mapping-metadata.xml
@@ -66,21 +66,6 @@
               <id>org.maven.ide.eclipse.configuration.wtp.overlay.configurator</id>
             </configurator>
           </action>
-        </pluginExecution>
-		<pluginExecution>
-          <pluginExecutionFilter>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-war-plugin</artifactId>
-            <versionRange>[2.0.1,)</versionRange>
-            <goals>
-              <goal>war</goal>
-            </goals>
-          </pluginExecutionFilter>
-          <action>
-            <configurator>
-              <id>org.maven.ide.eclipse.configuration.wtp.nonjava.unsupportedDependencyTypeConfigurator</id>
-            </configurator>
-          </action>
         </pluginExecution>       
         <pluginExecution>
           <pluginExecutionFilter>
@@ -134,21 +119,6 @@
               <id>org.maven.ide.eclipse.configuration.wtp.ejbmanifest.configurator</id>
             </configurator>
           </action>
-        </pluginExecution>
-      <pluginExecution>
-          <pluginExecutionFilter>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-ejb-plugin</artifactId>
-            <versionRange>[1.0,)</versionRange>
-            <goals>
-              <goal>ejb</goal>
-            </goals>
-          </pluginExecutionFilter>
-          <action>
-            <configurator>
-              <id>org.maven.ide.eclipse.configuration.wtp.nonjava.unsupportedDependencyTypeConfigurator</id>
-            </configurator>
-          </action>
         </pluginExecution>          
       </pluginExecutions>
     </lifecycleMapping>
@@ -199,12 +169,10 @@
           </pluginExecutionFilter>
           <action>
             <configurator>
-              <id>org.maven.ide.eclipse.configuration.wtp.nonjava.unsupportedDependencyTypeConfigurator</id>
+              <id>org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator</id>
             </configurator>
           </action>
-        </pluginExecution>
-        
-        
+        </pluginExecution>  
       </pluginExecutions>
     </lifecycleMapping>
     <lifecycleMapping>
@@ -240,22 +208,7 @@
               <id>org.maven.ide.eclipse.configuration.wtp.rarmanifest.configurator</id>
             </configurator>
           </action>
-        </pluginExecution>
-        <pluginExecution>
-          <pluginExecutionFilter>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-rar-plugin</artifactId>
-            <versionRange>[1.0,)</versionRange>
-            <goals>
-              <goal>rar</goal>
-            </goals>
-          </pluginExecutionFilter>
-          <action>
-            <configurator>
-              <id>org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator</id>
-            </configurator>
-          </action>
-        </pluginExecution>        
+        </pluginExecution>       
       </pluginExecutions>
     </lifecycleMapping>
     <lifecycleMapping>
@@ -292,21 +245,6 @@
             </configurator>
           </action>
         </pluginExecution>
-        <pluginExecution>
-          <pluginExecutionFilter>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-acr-plugin</artifactId>
-            <versionRange>[1.0,)</versionRange>
-            <goals>
-              <goal>acr</goal>
-            </goals>
-          </pluginExecutionFilter>
-          <action>
-            <configurator>
-              <id>org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator</id>
-            </configurator>
-          </action>
-        </pluginExecution>      
       </pluginExecutions>
     </lifecycleMapping>
     
diff --git a/org.eclipse.m2e.wtp/plugin.xml b/org.eclipse.m2e.wtp/plugin.xml
index e149908..6d0502d 100644
--- a/org.eclipse.m2e.wtp/plugin.xml
+++ b/org.eclipse.m2e.wtp/plugin.xml
@@ -50,14 +50,14 @@
           id="org.maven.ide.eclipse.configuration.wtp.overlay.configurator"
           class="org.eclipse.m2e.wtp.OverlayConfigurator"
           name="Overlay" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"/>
+          runsAfter="org.maven.ide.eclipse.configuration.wtp.configurator"/>
     </extension>        
 	<extension point="org.eclipse.m2e.core.projectConfigurators">
       <configurator 
           id="org.maven.ide.eclipse.configuration.wtp.warmanifest.configurator"
           class="org.eclipse.m2e.wtp.internal.mavenarchiver.WarMavenArchiverConfigurator"
           name="WarManifestConfigurator" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"
+          runsAfter="org.maven.ide.eclipse.configuration.wtp.configurator"
           />
     </extension>  
    	<extension point="org.eclipse.m2e.core.projectConfigurators">
@@ -65,7 +65,7 @@
           id="org.maven.ide.eclipse.configuration.wtp.ejbmanifest.configurator"
           class="org.eclipse.m2e.wtp.internal.mavenarchiver.EjbMavenArchiverConfigurator"
           name="EjbManifestConfigurator" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"
+          runsAfter="org.maven.ide.eclipse.configuration.wtp.configurator"
           />
     </extension> 
 	<extension point="org.eclipse.m2e.core.projectConfigurators">
@@ -80,7 +80,7 @@
           id="org.maven.ide.eclipse.configuration.wtp.rarmanifest.configurator"
           class="org.eclipse.m2e.wtp.internal.mavenarchiver.RarMavenArchiverConfigurator"
           name="RarManifestConfigurator" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"
+          runsAfter="org.maven.ide.eclipse.configuration.wtp.configurator"
           />
     </extension>  
 	<extension point="org.eclipse.m2e.core.projectConfigurators">
@@ -88,7 +88,7 @@
           id="org.maven.ide.eclipse.configuration.wtp.acrmanifest.configurator"
           class="org.eclipse.m2e.wtp.internal.mavenarchiver.AcrMavenArchiverConfigurator"
           name="AcrManifestConfigurator" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"
+          runsAfter="org.maven.ide.eclipse.configuration.wtp.configurator"
           />
     </extension>                    
     
@@ -97,7 +97,7 @@
           id="org.maven.ide.eclipse.configuration.wtp.webfragment.configurator"
           class="org.eclipse.m2e.wtp.WebFragmentProjectConfigurator"
           name="WebFragmentConfigurator" 
-          secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"
+          runsAfter="org.eclipse.m2e.jdt.javaConfigurator"
           />
     </extension> 
     
@@ -106,7 +106,7 @@
           id="org.maven.ide.eclipse.configuration.wtp.utility.configurator"
           class="org.eclipse.m2e.wtp.UtilityProjectConfigurator"
           name="UtilityConfigurator" 
-          secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"
+          runsAfter="org.eclipse.m2e.jdt.javaConfigurator"
           />
     </extension>     
 
@@ -114,19 +114,10 @@
       <configurator 
           id="org.maven.ide.eclipse.configuration.wtp.java.unsupportedDependencyTypeConfigurator"
           class="org.eclipse.m2e.wtp.UnsupportedDependencyTypeProjectConfigurator"
-          name="Unsupported Dependency Type Project Configurator - for Java projects" 
-          secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"
+          name="Unsupported Dependency Type Project Configurator" 
+          runsAfter="org.eclipse.m2e.jdt.javaConfigurator?,org.maven.ide.eclipse.configuration.wtp.configurator?"
           />
     </extension>
-    <!-- This one is used for EAR projects that don't have a java nature -->  
-  	<extension point="org.eclipse.m2e.core.projectConfigurators">
-      <configurator 
-          id="org.maven.ide.eclipse.configuration.wtp.nonjava.unsupportedDependencyTypeConfigurator"
-          class="org.eclipse.m2e.wtp.UnsupportedDependencyTypeProjectConfigurator"
-          name="Unsupported Dependency Type Project Configurator - for non-Java projects" 
-          secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"
-          />
-    </extension>  
 
    <!-- A workaround to allow to uninstall WTP facets -->   
    <extension point="org.eclipse.wst.common.project.facet.core.facets">
diff --git a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarProjectConfiguratorDelegate.java b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarProjectConfiguratorDelegate.java
index 78c4573..e6cac6b 100644
--- a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarProjectConfiguratorDelegate.java
+++ b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarProjectConfiguratorDelegate.java
@@ -179,13 +179,13 @@
     if(!facetedProject.hasProjectFacet(WTPProjectsUtil.EAR_FACET)) {
       return;
     }
-
     IVirtualComponent earComponent = ComponentCore.createComponent(project);
     
     Set<IVirtualReference> newRefs = new LinkedHashSet<>();
     
     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();
diff --git a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UnsupportedDependencyTypeProjectConfigurator.java b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UnsupportedDependencyTypeProjectConfigurator.java
index 2011170..1957afb 100644
--- a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UnsupportedDependencyTypeProjectConfigurator.java
+++ b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UnsupportedDependencyTypeProjectConfigurator.java
@@ -55,14 +55,12 @@
 
   @Override
   public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
-	  IMavenProjectFacade facade =  request.getMavenProjectFacade();
-	  checkUnsupportedWorkspaceDependency(monitor, facade);
+	  checkUnsupportedWorkspaceDependency(monitor, request.getMavenProjectFacade());
   }
 
   @Override
   public void mavenProjectChanged(MavenProjectChangedEvent event, IProgressMonitor monitor) throws CoreException {
-    IMavenProjectFacade facade = event.getMavenProject();
-    checkUnsupportedWorkspaceDependency(monitor, facade);
+    checkUnsupportedWorkspaceDependency(monitor, event.getMavenProject());
   }
 
 /**
diff --git a/pom.xml b/pom.xml
index ca760cc..e68c4ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,7 +39,7 @@
     <!--
     <m2e-repo.url>http://download.eclipse.org/technology/m2e/milestones/1.6/</m2e-repo.url>
     -->
-    <m2e-repo.url>http://repository.takari.io:8081/nexus/content/sites/m2e.extras/m2e/1.6.0/N/LATEST/</m2e-repo.url>
+    <m2e-repo.url>http://download.eclipse.org/technology/m2e/snapshots/1.6.0/latest/</m2e-repo.url>
     <!-- Warning : changing the mavenarchiver version requires submitting a new CQ in ipzilla -->
     <!-- Use signed version of m2eclipse-mavenarchiver 0.16.0.201401211452, built on build.eclipse.org -->
     <mavenarchiver-repo.url>http://download.eclipse.org/m2e-wtp/signed/mavenarchiver/0.16.0/</mavenarchiver-repo.url>
@@ -300,7 +300,7 @@
         </plugins>
       </build>
     </profile>
-    
+
     <profile>
       <id>sdk</id>
       <activation>