You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2021/09/23 11:11:36 UTC

[maven] 01/01: Convert maven-core artifact-handlers to Providers

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch convert-artifact-handlers-xml
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 55d1eef32e9273309288c6b0327cc60c0a70c216
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Thu Sep 23 13:10:54 2021 +0200

    Convert maven-core artifact-handlers to Providers
    
    This change gets rid of another set of Plexus components
    defined in XML.
---
 .../artifact/handler/DefaultArtifactHandler.java   |  10 ++
 .../providers/EarArtifactHandlerProvider.java      |  53 ++++++
 .../providers/EjbArtifactHandlerProvider.java      |  53 ++++++
 .../EjbClientArtifactHandlerProvider.java          |  55 ++++++
 .../providers/JarArtifactHandlerProvider.java      |  52 ++++++
 .../JavaSourceArtifactHandlerProvider.java         |  54 ++++++
 .../providers/JavadocArtifactHandlerProvider.java  |  54 ++++++
 .../MavenPluginArtifactHandlerProvider.java        |  53 ++++++
 .../providers/PomArtifactHandlerProvider.java      |  50 ++++++
 .../providers/RarArtifactHandlerProvider.java      |  53 ++++++
 .../providers/TestJarArtifactHandlerProvider.java  |  55 ++++++
 .../providers/WarArtifactHandlerProvider.java      |  53 ++++++
 .../META-INF/plexus/artifact-handlers.xml          | 194 ---------------------
 13 files changed, 595 insertions(+), 194 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
index e4ab338..382227a 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
@@ -80,6 +80,11 @@ public class DefaultArtifactHandler
         return classifier;
     }
 
+    public void setClassifier( String classifier )
+    {
+        this.classifier = classifier;
+    }
+
     public String getDirectory()
     {
         if ( directory == null )
@@ -98,6 +103,11 @@ public class DefaultArtifactHandler
         return packaging;
     }
 
+    public void setPackaging( String packaging )
+    {
+        this.packaging = packaging;
+    }
+
     public boolean isIncludesDependencies()
     {
         return includesDependencies;
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EarArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EarArtifactHandlerProvider.java
new file mode 100644
index 0000000..ddbd2e7
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EarArtifactHandlerProvider.java
@@ -0,0 +1,53 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "ear" )
+@Singleton
+public class EarArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public EarArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "ear" );
+        handler.setIncludesDependencies( true );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( false );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbArtifactHandlerProvider.java
new file mode 100644
index 0000000..a463f9a
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbArtifactHandlerProvider.java
@@ -0,0 +1,53 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "ejb" )
+@Singleton
+public class EjbArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public EjbArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "ejb" );
+        handler.setExtension( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbClientArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbClientArtifactHandlerProvider.java
new file mode 100644
index 0000000..7b2d29b
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/EjbClientArtifactHandlerProvider.java
@@ -0,0 +1,55 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "ejb-client" )
+@Singleton
+public class EjbClientArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public EjbClientArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "ejb-client" );
+        handler.setExtension( "jar" );
+        handler.setPackaging( "ejb" );
+        handler.setClassifier( "client" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JarArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JarArtifactHandlerProvider.java
new file mode 100644
index 0000000..e800093
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JarArtifactHandlerProvider.java
@@ -0,0 +1,52 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "jar" )
+@Singleton
+public class JarArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public JarArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavaSourceArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavaSourceArtifactHandlerProvider.java
new file mode 100644
index 0000000..6d62807
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavaSourceArtifactHandlerProvider.java
@@ -0,0 +1,54 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "java-source" )
+@Singleton
+public class JavaSourceArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public JavaSourceArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "java-source" );
+        handler.setClassifier( "sources" );
+        handler.setExtension( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( false );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavadocArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavadocArtifactHandlerProvider.java
new file mode 100644
index 0000000..4c18b3c
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/JavadocArtifactHandlerProvider.java
@@ -0,0 +1,54 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "javadoc" )
+@Singleton
+public class JavadocArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public JavadocArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "javadoc" );
+        handler.setClassifier( "javadoc" );
+        handler.setExtension( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/MavenPluginArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/MavenPluginArtifactHandlerProvider.java
new file mode 100644
index 0000000..523733b
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/MavenPluginArtifactHandlerProvider.java
@@ -0,0 +1,53 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "maven-plugin" )
+@Singleton
+public class MavenPluginArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public MavenPluginArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "maven-plugin" );
+        handler.setExtension( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/PomArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/PomArtifactHandlerProvider.java
new file mode 100644
index 0000000..49d91a8
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/PomArtifactHandlerProvider.java
@@ -0,0 +1,50 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "pom" )
+@Singleton
+public class PomArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public PomArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "pom" );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/RarArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/RarArtifactHandlerProvider.java
new file mode 100644
index 0000000..ccc764f
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/RarArtifactHandlerProvider.java
@@ -0,0 +1,53 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "rar" )
+@Singleton
+public class RarArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public RarArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "rar" );
+        handler.setIncludesDependencies( true );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( false );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/TestJarArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/TestJarArtifactHandlerProvider.java
new file mode 100644
index 0000000..5933bd1
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/TestJarArtifactHandlerProvider.java
@@ -0,0 +1,55 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "test-jar" )
+@Singleton
+public class TestJarArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public TestJarArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "test-jar" );
+        handler.setClassifier( "tests" );
+        handler.setExtension( "jar" );
+        handler.setPackaging( "jar" );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( true );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/WarArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/WarArtifactHandlerProvider.java
new file mode 100644
index 0000000..b6d84bd
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/WarArtifactHandlerProvider.java
@@ -0,0 +1,53 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+@Named( "war" )
+@Singleton
+public class WarArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public WarArtifactHandlerProvider()
+    {
+        DefaultArtifactHandler handler = new DefaultArtifactHandler( "war" );
+        handler.setIncludesDependencies( true );
+        handler.setLanguage( "java" );
+        handler.setAddedToClasspath( false );
+
+        this.artifactHandler = handler;
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}
diff --git a/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml b/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml
deleted file mode 100644
index 2f26ce2..0000000
--- a/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!--
-
-Artifact handlers are required by the dependency resolution mechanism.
-
--->
-
-<component-set>
-  <components>
-    <!--
-     | POM
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>pom</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>pom</type>
-      </configuration>
-    </component>
-
-    <!--
-     | JAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>jar</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>jar</type>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | EJB
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>ejb</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>ejb</type>
-        <extension>jar</extension>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>ejb-client</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>ejb-client</type>
-        <extension>jar</extension>
-        <packaging>ejb</packaging>
-        <classifier>client</classifier>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | TEST JAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>test-jar</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <classifier>tests</classifier>
-        <extension>jar</extension>
-        <type>test-jar</type>
-        <packaging>jar</packaging>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | MAVEN PLUGIN
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>maven-plugin</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>maven-plugin</type>
-        <extension>jar</extension>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | SOURCE JAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>java-source</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <classifier>sources</classifier>
-        <type>java-source</type>
-        <extension>jar</extension>
-        <language>java</language>
-        <addedToClasspath>false</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | JAVADOC JAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>javadoc</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <classifier>javadoc</classifier>
-        <type>javadoc</type>
-        <extension>jar</extension>
-        <language>java</language>
-        <addedToClasspath>true</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | WAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>war</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>war</type>
-        <includesDependencies>true</includesDependencies>
-        <language>java</language>
-        <addedToClasspath>false</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | EAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>ear</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>ear</type>
-        <includesDependencies>true</includesDependencies>
-        <language>java</language>
-        <addedToClasspath>false</addedToClasspath>
-      </configuration>
-    </component>
-
-    <!--
-     | RAR
-     |-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>rar</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>rar</type>
-        <includesDependencies>true</includesDependencies>
-        <language>java</language>
-        <addedToClasspath>false</addedToClasspath>
-      </configuration>
-    </component>
-
-  </components>
-</component-set>