You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2016/09/15 21:10:48 UTC

[1/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Repository: maven-resolver
Updated Branches:
  refs/heads/ant-tasks 1e6e27844 -> b5f1ab9c4


http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReaderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReaderTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReaderTest.java
new file mode 100644
index 0000000..0b7dfa3
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReaderTest.java
@@ -0,0 +1,124 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import org.apache.maven.resolver.internal.ant.ProjectWorkspaceReader;
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.apache.tools.ant.Project;
+import org.junit.Before;
+import org.junit.Test;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+
+public class ProjectWorkspaceReaderTest
+{
+
+    private ProjectWorkspaceReader reader;
+
+    private Project project;
+
+    @Before
+    public void setUp()
+        throws Exception
+    {
+        this.reader = new ProjectWorkspaceReader();
+
+        this.project = new Project();
+        project.setProperty( "user.home", System.getProperty( "user.home" ) );
+    }
+
+    private Artifact artifact( String coords )
+    {
+        return new DefaultArtifact( coords );
+    }
+
+    private File getFile( String name )
+    {
+        return new File( "src/test/resources/ProjectWorkspaceReader", name );
+    }
+
+    @Test
+    public void testFindPom()
+    {
+        Pom pom = new Pom();
+        pom.setProject( project );
+        pom.setFile( getFile( "dummy-pom.xml" ) );
+
+        reader.addPom( pom );
+
+        assertEquals( pom.getFile(), reader.findArtifact( artifact( "test:dummy:pom:0.1-SNAPSHOT" ) ) );
+        assertNull( reader.findArtifact( artifact( "unavailable:test:pom:0.1-SNAPSHOT" ) ) );
+    }
+
+    @Test
+    public void testFindArtifact()
+    {
+        Pom pom = new Pom();
+        pom.setProject( project );
+        pom.setFile( getFile( "dummy-pom.xml" ) );
+
+        reader.addPom( pom );
+
+        org.apache.maven.resolver.internal.ant.types.Artifact artifact = new org.apache.maven.resolver.internal.ant.types.Artifact();
+        artifact.setProject( project );
+        artifact.addPom( pom );
+        artifact.setFile( getFile( "dummy-file.txt" ) );
+
+        reader.addArtifact( artifact );
+
+        assertEquals( artifact.getFile(), reader.findArtifact( artifact( "test:dummy:txt:0.1-SNAPSHOT" ) ) );
+        assertNull( reader.findArtifact( artifact( "unavailable:test:jar:0.1-SNAPSHOT" ) ) );
+    }
+
+    @Test
+    public void testFindVersions()
+    {
+        Pom pom1 = new Pom();
+        pom1.setProject( project );
+        pom1.setCoords( "test:dummy:1-SNAPSHOT" );
+
+        org.apache.maven.resolver.internal.ant.types.Artifact artifact1 = new org.apache.maven.resolver.internal.ant.types.Artifact();
+        artifact1.setProject( project );
+        artifact1.addPom( pom1 );
+        artifact1.setFile( getFile( "dummy-file.txt" ) );
+
+        reader.addArtifact( artifact1 );
+
+        Pom pom2 = new Pom();
+        pom2.setProject( project );
+        pom2.setCoords( "test:dummy:2-SNAPSHOT" );
+
+        org.apache.maven.resolver.internal.ant.types.Artifact artifact2 = new org.apache.maven.resolver.internal.ant.types.Artifact();
+        artifact2.setProject( project );
+        artifact2.addPom( pom2 );
+        artifact2.setFile( getFile( "dummy-file.txt" ) );
+
+        reader.addArtifact( artifact2 );
+
+        assertThat( reader.findVersions( artifact( "test:dummy:txt:[0,)" ) ),
+                    containsInAnyOrder( "1-SNAPSHOT", "2-SNAPSHOT" ) );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/ReactorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/ReactorTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/ReactorTest.java
new file mode 100644
index 0000000..6b33710
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/ReactorTest.java
@@ -0,0 +1,100 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.resolver.internal.ant.ProjectWorkspaceReader;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+
+public class ReactorTest
+    extends AntBuildsTest
+{
+
+    private Artifact artifact( String coords )
+    {
+        return new DefaultArtifact( coords );
+    }
+
+    public void testPom()
+        throws IOException
+    {
+        executeTarget( "testPom" );
+        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
+        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
+        assertNotNull( found );
+        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
+    }
+
+    public void testArtifact()
+        throws IOException
+    {
+        executeTarget( "testArtifact" );
+        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
+        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
+        assertNotNull( found );
+        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
+
+        found = reader.findArtifact( artifact( "test:test:xml:0.1-SNAPSHOT" ) );
+        assertNotNull( found );
+        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
+    }
+
+    public void testArtifactInMemoryPom()
+        throws IOException
+    {
+        executeTarget( "testArtifactInMemoryPom" );
+        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
+        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
+        assertNull( found );
+
+        found = reader.findArtifact( artifact( "test:test:xml:0.1-SNAPSHOT" ) );
+        assertNotNull( found );
+        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
+    }
+
+    public void testResolveArtifact()
+        throws IOException
+    {
+        executeTarget( "testResolveArtifact" );
+        String prop = project.getProperty( "resolve.test:test:jar" );
+        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
+    }
+
+    public void testResolveArtifactInMemoryPom()
+        throws IOException
+    {
+        executeTarget( "testResolveArtifactInMemoryPom" );
+        String prop = project.getProperty( "resolve.test:test:jar" );
+        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
+        assertLogContaining( "The POM for test:test:jar:0.1-SNAPSHOT is missing, no dependency information available" );
+    }
+
+    public void testResolveVersionRange()
+        throws IOException
+    {
+        executeTarget( "testResolveVersionRange" );
+        String prop = project.getProperty( "resolve.test:test:jar" );
+        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java
new file mode 100644
index 0000000..a736a74
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java
@@ -0,0 +1,150 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.ResourceCollection;
+import org.apache.tools.ant.types.resources.FileResource;
+
+public class ResolveTest
+    extends AntBuildsTest
+{
+
+    public void testResolveGlobalPom()
+    {
+        executeTarget( "testResolveGlobalPom" );
+
+        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
+        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
+        assertThat( "aether-api was not resolved to default local repository", prop,
+                    allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) );
+    }
+
+    public void testResolveOverrideGlobalPom()
+    {
+        executeTarget( "testResolveOverrideGlobalPom" );
+
+        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
+        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
+        assertThat( "aether-api was not resolved to default local repository", prop,
+                    allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) );
+    }
+
+    public void testResolveGlobalPomIntoOtherLocalRepo()
+    {
+        executeTarget( "testResolveGlobalPomIntoOtherLocalRepo" );
+
+        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
+        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
+        assertThat( "aether-api was not resolved to default local repository", prop.replace( '\\', '/' ),
+                    endsWith( "local-repo-custom/org/eclipse/aether/aether-api/0.9.0.M3/aether-api-0.9.0.M3.jar" ) );
+    }
+
+    public void testResolveCustomFileLayout()
+        throws IOException
+    {
+        File dir = new File( BUILD_DIR, "resolve-custom-layout" );
+        executeTarget( "testResolveCustomFileLayout" );
+
+        assertThat( "aether-api was not saved with custom file layout",
+                    new File( dir, "org.eclipse.aether/aether-api/org/eclipse/aether/jar" ).exists() );
+    }
+
+    public void testResolveAttachments()
+        throws IOException
+    {
+        File dir = new File( BUILD_DIR, "resolve-attachments" );
+        executeTarget( "testResolveAttachments" );
+        
+        File jdocDir = new File(dir, "javadoc");
+        
+        assertThat( "aether-api-javadoc was not saved with custom file layout",
+                    new File( jdocDir, "org.eclipse.aether-aether-api-javadoc.jar" ).exists() );
+
+        assertThat( "found non-javadoc files", Arrays.asList( jdocDir.list() ), everyItem( endsWith( "javadoc.jar" ) ) );
+
+        File sourcesDir = new File( dir, "sources" );
+        assertThat( "aether-api-sources was not saved with custom file layout",
+                    new File( sourcesDir, "org.eclipse.aether-aether-api-sources.jar" ).exists() );
+        assertThat( "found non-sources files", Arrays.asList( sourcesDir.list() ),
+                    everyItem( endsWith( "sources.jar" ) ) );
+    }
+
+    public void testResolvePath()
+    {
+        executeTarget( "testResolvePath" );
+        Map<?, ?> refs = getProject().getReferences();
+        Object obj = refs.get( "out" );
+        assertThat( "ref 'out' is no path", obj, instanceOf( Path.class ) );
+        Path path = (Path) obj;
+        String[] elements = path.list();
+        assertThat( "no aether-api on classpath", elements,
+                    hasItemInArray( allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) ) );
+    }
+
+    public void testResolveDepsFromFile()
+    {
+        executeTarget( "testResolveDepsFromFile" );
+
+        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-spi:jar" );
+        assertThat( "aether-spi was not resolved as a property", prop, notNullValue() );
+        assertThat( "aether-spi was not resolved to default local repository", prop,
+                    allOf( containsString( "aether-spi" ), endsWith( ".jar" ) ) );
+        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
+        assertThat( "aether-api was resolved as a property", prop, nullValue() );
+    }
+
+    public void testResolveNestedDependencyCollections()
+    {
+        executeTarget( "testResolveNestedDependencyCollections" );
+
+        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-spi:jar" );
+        assertThat( "aether-spi was not resolved as a property", prop, notNullValue() );
+        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-util:jar" );
+        assertThat( "aether-util was not resolved as a property", prop, notNullValue() );
+        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
+        assertThat( "aether-api was resolved as a property", prop, nullValue() );
+    }
+
+    public void testResolveResourceCollectionOnly()
+    {
+        executeTarget( "testResolveResourceCollectionOnly" );
+
+        ResourceCollection resources = (ResourceCollection) getProject().getReference( "files" );
+        assertThat( resources, is( notNullValue() ) );
+        assertThat( resources.size(), is( 2 ) );
+        assertThat( resources.isFilesystemOnly(), is( true ) );
+        Iterator<?> it = resources.iterator();
+        FileResource file = (FileResource) it.next();
+        assertThat( file.getFile().getName(), is( "aether-spi-0.9.0.v20140226.jar" ) );
+        file = (FileResource) it.next();
+        assertThat( file.getFile().getName(), is( "aether-api-0.9.0.v20140226.jar" ) );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/SettingsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/SettingsTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/SettingsTest.java
new file mode 100644
index 0000000..a22d573
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/SettingsTest.java
@@ -0,0 +1,65 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+
+public class SettingsTest
+    extends AntBuildsTest
+{
+
+    public void testUserSettings()
+    {
+        executeTarget( "testUserSettings" );
+        assertThat( "user settings not set", AntRepoSys.getInstance( getProject() ).getUserSettings().getName(),
+                    equalTo( "userSettings.xml" ) );
+    }
+
+    public void testGlobalSettings()
+    {
+        executeTarget( "testGlobalSettings" );
+        assertThat( "global settings not set", AntRepoSys.getInstance( getProject() ).getGlobalSettings().getName(),
+                    equalTo( "globalSettings.xml" ) );
+    }
+
+    public void testBothSettings()
+    {
+        executeTarget( "testBothSettings" );
+        assertThat( "global settings not set", AntRepoSys.getInstance( getProject() ).getGlobalSettings().getName(),
+                    equalTo( "globalSettings.xml" ) );
+        assertThat( "user settings not set", AntRepoSys.getInstance( getProject() ).getUserSettings().getName(),
+                    equalTo( "userSettings.xml" ) );
+    }
+
+    public void testFallback()
+        throws IOException
+    {
+        executeTarget("setUp");
+        assertThat( "no fallback to local settings",
+                    AntRepoSys.getInstance( getProject() ).getUserSettings().getAbsolutePath(), endsWith( ".m2"
+                        + File.separator + "settings.xml" ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/tasks/LayoutTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/tasks/LayoutTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/tasks/LayoutTest.java
new file mode 100644
index 0000000..f79729b
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/tasks/LayoutTest.java
@@ -0,0 +1,55 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 static org.junit.Assert.assertEquals;
+
+import org.apache.maven.resolver.internal.ant.tasks.Layout;
+import org.apache.tools.ant.BuildException;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.junit.Test;
+
+/**
+ */
+public class LayoutTest
+{
+
+    @Test( expected = BuildException.class )
+    public void testUnknownVariable()
+    {
+        new Layout( "{unknown}" );
+    }
+
+    @Test
+    public void testGetPath()
+    {
+        Layout layout;
+
+        layout =
+            new Layout( "{groupIdDirs}/{artifactId}/{baseVersion}/{artifactId}-{version}-{classifier}.{extension}" );
+        assertEquals( "org/apache/maven/maven-model/3.0-SNAPSHOT/maven-model-3.0-20100720.132618-1.jar",
+                      layout.getPath( new DefaultArtifact( "org.apache.maven:maven-model:3.0-20100720.132618-1" ) ) );
+
+        layout = new Layout( "{groupId}/{artifactId}-{version}-{classifier}.{extension}" );
+        assertEquals( "org.apache.maven/maven-model-3.0-sources.jar",
+                      layout.getPath( new DefaultArtifact( "org.apache.maven:maven-model:jar:sources:3.0" ) ) );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/types/DependencyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/types/DependencyTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/types/DependencyTest.java
new file mode 100644
index 0000000..10ca42b
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/types/DependencyTest.java
@@ -0,0 +1,88 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 static org.junit.Assert.*;
+
+import org.apache.maven.resolver.internal.ant.types.Dependency;
+import org.junit.Test;
+
+/**
+ */
+public class DependencyTest
+{
+
+    @Test
+    public void testSetCoordsGidAidVer()
+    {
+        Dependency dep = new Dependency();
+        dep.setCoords( "gid:aid:ver" );
+
+        assertEquals( "gid", dep.getGroupId() );
+        assertEquals( "aid", dep.getArtifactId() );
+        assertEquals( "ver", dep.getVersion() );
+        assertEquals( "jar", dep.getType() );
+        assertEquals( "", dep.getClassifier() );
+        assertEquals( "compile", dep.getScope() );
+    }
+
+    @Test
+    public void testSetCoordsGidAidVerScope()
+    {
+        Dependency dep = new Dependency();
+        dep.setCoords( "gid:aid:ver:scope" );
+
+        assertEquals( "gid", dep.getGroupId() );
+        assertEquals( "aid", dep.getArtifactId() );
+        assertEquals( "ver", dep.getVersion() );
+        assertEquals( "jar", dep.getType() );
+        assertEquals( "", dep.getClassifier() );
+        assertEquals( "scope", dep.getScope() );
+    }
+
+    @Test
+    public void testSetCoordsGidAidVerTypeScope()
+    {
+        Dependency dep = new Dependency();
+        dep.setCoords( "gid:aid:ver:type:scope" );
+
+        assertEquals( "gid", dep.getGroupId() );
+        assertEquals( "aid", dep.getArtifactId() );
+        assertEquals( "ver", dep.getVersion() );
+        assertEquals( "type", dep.getType() );
+        assertEquals( "", dep.getClassifier() );
+        assertEquals( "scope", dep.getScope() );
+    }
+
+    @Test
+    public void testSetCoordsGidAidVerTypeClsScope()
+    {
+        Dependency dep = new Dependency();
+        dep.setCoords( "gid:aid:ver:type:cls:scope" );
+
+        assertEquals( "gid", dep.getGroupId() );
+        assertEquals( "aid", dep.getArtifactId() );
+        assertEquals( "ver", dep.getVersion() );
+        assertEquals( "type", dep.getType() );
+        assertEquals( "cls", dep.getClassifier() );
+        assertEquals( "scope", dep.getScope() );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/types/ExclusionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/types/ExclusionTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/types/ExclusionTest.java
new file mode 100644
index 0000000..64d510f
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/types/ExclusionTest.java
@@ -0,0 +1,88 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 static org.junit.Assert.*;
+
+import org.apache.maven.resolver.internal.ant.types.Exclusion;
+import org.junit.Test;
+
+/**
+ */
+public class ExclusionTest
+{
+
+    @Test
+    public void testSetCoordsGid()
+    {
+        Exclusion ex = new Exclusion();
+        ex.setCoords( "gid" );
+
+        assertEquals( "gid", ex.getGroupId() );
+        assertEquals( "*", ex.getArtifactId() );
+        assertEquals( "*", ex.getExtension() );
+        assertEquals( "*", ex.getClassifier() );
+    }
+
+    @Test
+    public void testSetCoordsGidAid()
+    {
+        Exclusion ex = new Exclusion();
+        ex.setCoords( "gid:aid" );
+
+        assertEquals( "gid", ex.getGroupId() );
+        assertEquals( "aid", ex.getArtifactId() );
+        assertEquals( "*", ex.getExtension() );
+        assertEquals( "*", ex.getClassifier() );
+    }
+
+    @Test
+    public void testSetCoordsGidAidExt()
+    {
+        Exclusion ex = new Exclusion();
+        ex.setCoords( "gid:aid:ext" );
+
+        assertEquals( "gid", ex.getGroupId() );
+        assertEquals( "aid", ex.getArtifactId() );
+        assertEquals( "ext", ex.getExtension() );
+        assertEquals( "*", ex.getClassifier() );
+    }
+
+    @Test
+    public void testSetCoordsGidAidExtCls()
+    {
+        Exclusion ex = new Exclusion();
+        ex.setCoords( "gid:aid:ext:cls" );
+
+        assertEquals( "gid", ex.getGroupId() );
+        assertEquals( "aid", ex.getArtifactId() );
+        assertEquals( "ext", ex.getExtension() );
+        assertEquals( "cls", ex.getClassifier() );
+
+        ex = new Exclusion();
+        ex.setCoords( "gid:aid:ext:" );
+
+        assertEquals( "gid", ex.getGroupId() );
+        assertEquals( "aid", ex.getArtifactId() );
+        assertEquals( "ext", ex.getExtension() );
+        assertEquals( "", ex.getClassifier() );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/types/PomTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/types/PomTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/types/PomTest.java
new file mode 100644
index 0000000..35131b1
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/types/PomTest.java
@@ -0,0 +1,43 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 static org.junit.Assert.*;
+
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.junit.Test;
+
+/**
+ */
+public class PomTest
+{
+
+    @Test
+    public void testSetCoordsGid()
+    {
+        Pom pom = new Pom();
+        pom.setCoords( "gid:aid:ver" );
+
+        assertEquals( "gid", pom.getGroupId() );
+        assertEquals( "aid", pom.getArtifactId() );
+        assertEquals( "ver", pom.getVersion() );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/Deploy/ant.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/Deploy/ant.xml b/src/test/resources/ant/Deploy/ant.xml
index 1b019f5..2ad2d7a 100644
--- a/src/test/resources/ant/Deploy/ant.xml
+++ b/src/test/resources/ant/Deploy/ant.xml
@@ -23,7 +23,7 @@
        <!ENTITY common SYSTEM "../common.xml">
 ]>
 
-<project xmlns:repo="antlib:org.apache.maven.aether.ant">
+<project xmlns:repo="antlib:org.apache.maven.resolver.ant">
 
   &common;
 

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/Install/ant.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/Install/ant.xml b/src/test/resources/ant/Install/ant.xml
index 1a3ace5..a4bd6eb 100644
--- a/src/test/resources/ant/Install/ant.xml
+++ b/src/test/resources/ant/Install/ant.xml
@@ -23,7 +23,7 @@
        <!ENTITY common SYSTEM "../common.xml">
 ]>
 
-<project xmlns:repo="antlib:org.apache.maven.aether.ant">
+<project xmlns:repo="antlib:org.apache.maven.resolver.ant">
 
   &common;
 

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/Reactor/ant.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/Reactor/ant.xml b/src/test/resources/ant/Reactor/ant.xml
index 3cc0ca9..7b7976a 100644
--- a/src/test/resources/ant/Reactor/ant.xml
+++ b/src/test/resources/ant/Reactor/ant.xml
@@ -23,7 +23,7 @@
        <!ENTITY common SYSTEM "../common.xml">
 ]>
 
-<project xmlns:repo="antlib:org.apache.maven.aether.ant">
+<project xmlns:repo="antlib:org.apache.maven.resolver.ant">
 
   &common;
   

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/Resolve/ant.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/Resolve/ant.xml b/src/test/resources/ant/Resolve/ant.xml
index fbad0c9..eb6a1c7 100644
--- a/src/test/resources/ant/Resolve/ant.xml
+++ b/src/test/resources/ant/Resolve/ant.xml
@@ -23,7 +23,7 @@
        <!ENTITY common SYSTEM "../common.xml">
 ]>
 
-<project xmlns:repo="antlib:org.apache.maven.aether.ant">
+<project xmlns:repo="antlib:org.apache.maven.resolver.ant">
 
   &common;
 

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/Settings/ant.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/Settings/ant.xml b/src/test/resources/ant/Settings/ant.xml
index 313885e..8c1f79a 100644
--- a/src/test/resources/ant/Settings/ant.xml
+++ b/src/test/resources/ant/Settings/ant.xml
@@ -23,7 +23,7 @@
        <!ENTITY common SYSTEM "../common.xml">
 ]>
 
-<project xmlns:repo="antlib:org.apache.maven.aether.ant">
+<project xmlns:repo="antlib:org.apache.maven.resolver.ant">
 
   &common;
 

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/resources/ant/common.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/ant/common.xml b/src/test/resources/ant/common.xml
index 669633d..02c0a57 100644
--- a/src/test/resources/ant/common.xml
+++ b/src/test/resources/ant/common.xml
@@ -17,4 +17,4 @@
   under the License.
 -->
 
-<taskdef uri="antlib:org.apache.maven.aether.ant" resource="org/eclipse/aether/ant/antlib.xml"/>
+<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml"/>


[6/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/Names.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/Names.java b/src/main/java/org/apache/maven/aether/internal/ant/Names.java
deleted file mode 100644
index 5ce8427..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/Names.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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.
- */
-
-/**
- */
-public final class Names
-{
-
-    private Names()
-    {
-        // hide constructor
-    }
-
-    public static final String ID = "aether";
-
-    public static final String ID_DEFAULT_REPOS = ID + ".repositories";
-
-    public static final String ID_DEFAULT_POM = ID + ".pom";
-
-    public static final String ID_CENTRAL = "central";
-
-    public static final String PROPERTY_OFFLINE = "aether.offline";
-
-    public static final String SETTINGS_XML = "settings.xml";
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReader.java b/src/main/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReader.java
deleted file mode 100644
index 7c77fc8..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReader.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.maven.aether.internal.ant.types.Pom;
-import org.apache.maven.model.Model;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.repository.WorkspaceReader;
-import org.eclipse.aether.repository.WorkspaceRepository;
-import org.eclipse.aether.util.artifact.ArtifactIdUtils;
-
-/**
- * Workspace reader caching available POMs and artifacts for ant builds.
- * <p/>
- * &lt;pom> elements are cached if they are defined by the 'file'-attribute, as they reference a backing pom.xml file that
- * can be used for resolution with Aether. &lt;artifact> elements are cached if they directly define a 'pom'-attribute
- * or child. The POM may be file-based or in-memory.
- */
-public class ProjectWorkspaceReader
-    implements WorkspaceReader
-{
-
-    private static volatile ProjectWorkspaceReader instance;
-
-    private static final Object LOCK = new Object();
-
-    private Map<String, Artifact> artifacts = new ConcurrentHashMap<String, Artifact>();
-
-    public void addPom( Pom pom )
-    {
-        if ( pom.getFile() != null )
-        {
-            Model model = pom.getModel( pom );
-            Artifact aetherArtifact =
-                new DefaultArtifact( model.getGroupId(), model.getArtifactId(), null, "pom", model.getVersion() );
-            aetherArtifact = aetherArtifact.setFile( pom.getFile() );
-            String coords = coords( aetherArtifact );
-            artifacts.put( coords, aetherArtifact );
-        }
-    }
-
-    public void addArtifact( org.apache.maven.aether.internal.ant.types.Artifact artifact )
-    {
-        if ( artifact.getPom() != null )
-        {
-            Pom pom = artifact.getPom();
-            Artifact aetherArtifact;
-            if ( pom.getFile() != null )
-            {
-                Model model = pom.getModel( pom );
-                aetherArtifact =
-                    new DefaultArtifact( model.getGroupId(), model.getArtifactId(), artifact.getClassifier(),
-                                         artifact.getType(), model.getVersion() );
-            }
-            else
-            {
-                aetherArtifact =
-                    new DefaultArtifact( pom.getGroupId(), pom.getArtifactId(), artifact.getClassifier(),
-                                         artifact.getType(), pom.getVersion() );
-            }
-            aetherArtifact = aetherArtifact.setFile( artifact.getFile() );
-
-            String coords = coords( aetherArtifact );
-            artifacts.put( coords, aetherArtifact );
-        }
-    }
-
-    private String coords( Artifact artifact )
-    {
-        return ArtifactIdUtils.toId( artifact );
-    }
-
-    public WorkspaceRepository getRepository()
-    {
-        return new WorkspaceRepository( "ant" );
-    }
-
-    public File findArtifact( Artifact artifact )
-    {
-        artifact = artifacts.get( coords( artifact ) );
-        return ( artifact != null ) ? artifact.getFile() : null;
-    }
-
-    public List<String> findVersions( Artifact artifact )
-    {
-        List<String> versions = new ArrayList<String>();
-        for ( Artifact art : artifacts.values() )
-        {
-            if ( ArtifactIdUtils.equalsVersionlessId( artifact, art ) )
-            {
-                versions.add( art.getVersion() );
-            }
-        }
-        return versions;
-    }
-
-    ProjectWorkspaceReader()
-    {
-    }
-
-    public static ProjectWorkspaceReader getInstance()
-    {
-        if ( instance == null )
-        {
-            synchronized ( LOCK )
-            {
-                if ( instance == null )
-                {
-                    instance = new ProjectWorkspaceReader();
-                }
-            }
-        }
-        return instance;
-    }
-
-    static void dropInstance()
-    {
-        instance = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/SettingsUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/SettingsUtils.java b/src/main/java/org/apache/maven/aether/internal/ant/SettingsUtils.java
deleted file mode 100644
index 59055dd..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/SettingsUtils.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.settings.Activation;
-import org.apache.maven.settings.ActivationFile;
-import org.apache.maven.settings.ActivationOS;
-import org.apache.maven.settings.ActivationProperty;
-import org.apache.maven.settings.Profile;
-import org.apache.maven.settings.Repository;
-import org.apache.maven.settings.RepositoryPolicy;
-
-/**
- * Utility methods to read settings from Mavens settings.xml.
- */
-class SettingsUtils
-{
-
-    public static List<org.apache.maven.model.Profile> convert( List<Profile> profiles )
-    {
-        if ( profiles == null )
-        {
-            return null;
-        }
-
-        List<org.apache.maven.model.Profile> results = new ArrayList<org.apache.maven.model.Profile>();
-
-        for ( Profile profile : profiles )
-        {
-            results.add( convert( profile ) );
-        }
-
-        return results;
-    }
-
-    static org.apache.maven.model.Profile convert( Profile profile )
-    {
-        if ( profile == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.Profile result = new org.apache.maven.model.Profile();
-
-        result.setId( profile.getId() );
-        result.setProperties( profile.getProperties() );
-        result.setSource( "settings.xml" );
-        result.setActivation( convert( profile.getActivation() ) );
-
-        for ( Repository repo : profile.getRepositories() )
-        {
-            result.addRepository( convert( repo ) );
-        }
-
-        for ( Repository repo : profile.getPluginRepositories() )
-        {
-            result.addPluginRepository( convert( repo ) );
-        }
-
-        return result;
-    }
-
-    static org.apache.maven.model.Activation convert( Activation activation )
-    {
-        if ( activation == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.Activation result = new org.apache.maven.model.Activation();
-
-        result.setActiveByDefault( activation.isActiveByDefault() );
-        result.setJdk( activation.getJdk() );
-        result.setFile( convert( activation.getFile() ) );
-        result.setProperty( convert( activation.getProperty() ) );
-        result.setOs( convert( activation.getOs() ) );
-
-        return result;
-    }
-
-    static org.apache.maven.model.ActivationOS convert( ActivationOS activation )
-    {
-        if ( activation == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.ActivationOS result = new org.apache.maven.model.ActivationOS();
-
-        result.setArch( activation.getArch() );
-        result.setFamily( activation.getFamily() );
-        result.setName( activation.getName() );
-        result.setVersion( activation.getVersion() );
-
-        return result;
-    }
-
-    static org.apache.maven.model.ActivationProperty convert( ActivationProperty activation )
-    {
-        if ( activation == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.ActivationProperty result = new org.apache.maven.model.ActivationProperty();
-
-        result.setName( activation.getName() );
-        result.setValue( activation.getValue() );
-
-        return result;
-    }
-
-    static org.apache.maven.model.ActivationFile convert( ActivationFile activation )
-    {
-        if ( activation == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.ActivationFile result = new org.apache.maven.model.ActivationFile();
-
-        result.setExists( activation.getExists() );
-        result.setMissing( activation.getMissing() );
-
-        return result;
-    }
-
-    static org.apache.maven.model.Repository convert( Repository repo )
-    {
-        if ( repo == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.Repository result = new org.apache.maven.model.Repository();
-
-        result.setId( repo.getId() );
-        result.setUrl( repo.getUrl() );
-        result.setLayout( repo.getLayout() );
-        result.setReleases( convert( repo.getReleases() ) );
-        result.setSnapshots( convert( repo.getSnapshots() ) );
-
-        return result;
-    }
-
-    static org.apache.maven.model.RepositoryPolicy convert( RepositoryPolicy policy )
-    {
-        if ( policy == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.RepositoryPolicy result = new org.apache.maven.model.RepositoryPolicy();
-
-        result.setEnabled( policy.isEnabled() );
-        result.setChecksumPolicy( policy.getChecksumPolicy() );
-        result.setUpdatePolicy( policy.getUpdatePolicy() );
-
-        return result;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractDistTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractDistTask.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractDistTask.java
deleted file mode 100644
index 2011507..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractDistTask.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.maven.aether.internal.ant.types.Artifact;
-import org.apache.maven.aether.internal.ant.types.Artifacts;
-import org.apache.maven.aether.internal.ant.types.Pom;
-import org.apache.maven.model.Model;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public abstract class AbstractDistTask
-    extends Task
-{
-
-    private Pom pom;
-
-    private Artifacts artifacts;
-
-    protected void validate()
-    {
-        getArtifacts().validate( this );
-
-        Map<String, File> duplicates = new HashMap<String, File>();
-        for ( Artifact artifact : getArtifacts().getArtifacts() )
-        {
-            String key = artifact.getType() + ':' + artifact.getClassifier();
-            if ( "pom:".equals( key ) )
-            {
-                throw new BuildException( "You must not specify an <artifact> with type=pom"
-                    + ", please use the <pom> element instead." );
-            }
-            else if ( duplicates.containsKey( key ) )
-            {
-                throw new BuildException( "You must not specify two or more artifacts with the same type ("
-                    + artifact.getType() + ") and classifier (" + artifact.getClassifier() + ")" );
-            }
-            else
-            {
-                duplicates.put( key, artifact.getFile() );
-            }
-
-            validateArtifactGav( artifact );
-        }
-
-        Pom defaultPom = AntRepoSys.getInstance( getProject() ).getDefaultPom();
-        if ( pom == null && defaultPom != null )
-        {
-            log( "Using default POM (" + defaultPom.getCoords() + ")", Project.MSG_INFO );
-            pom = defaultPom;
-        }
-
-        if ( pom == null )
-        {
-            throw new BuildException( "You must specify the <pom file=\"...\"> element"
-                + " to denote the descriptor for the artifacts" );
-        }
-        if ( pom.getFile() == null )
-        {
-            throw new BuildException( "You must specify a <pom> element that has the 'file' attribute set" );
-        }
-    }
-
-    private void validateArtifactGav( Artifact artifact )
-    {
-        Pom artifactPom = artifact.getPom();
-        if ( artifactPom != null )
-        {
-            String gid;
-            String aid;
-            String version;
-            if ( artifactPom.getFile() != null )
-            {
-                Model model = artifactPom.getModel( this );
-                gid = model.getGroupId();
-                aid = model.getArtifactId();
-                version = model.getVersion();
-            }
-            else
-            {
-                gid = artifactPom.getGroupId();
-                aid = artifactPom.getArtifactId();
-                version = artifactPom.getVersion();
-            }
-            
-            Model model = getPom().getModel( this );
-            
-            if ( ! ( model.getGroupId().equals( gid ) && model.getArtifactId().equals( aid ) && model.getVersion().equals( version ) ) )
-            {
-                throw new BuildException( "Artifact references different pom than it would be installed with: "
-                    + artifact.toString() );
-            }
-        }
-    }
-
-    protected Artifacts getArtifacts()
-    {
-        if ( artifacts == null )
-        {
-            artifacts = new Artifacts();
-            artifacts.setProject( getProject() );
-        }
-        return artifacts;
-    }
-
-    public void addArtifact( Artifact artifact )
-    {
-        getArtifacts().addArtifact( artifact );
-    }
-
-    public void addArtifacts( Artifacts artifacts )
-    {
-        getArtifacts().addArtifacts( artifacts );
-    }
-
-    public void setArtifactsRef( Reference ref )
-    {
-        Artifacts artifacts = new Artifacts();
-        artifacts.setProject( getProject() );
-        artifacts.setRefid( ref );
-        getArtifacts().addArtifacts( artifacts );
-    }
-
-    protected Pom getPom()
-    {
-        if ( pom == null )
-        {
-            return AntRepoSys.getInstance( getProject() ).getDefaultPom();
-        }
-
-        return pom;
-    }
-
-    public void addPom( Pom pom )
-    {
-        if ( this.pom != null )
-        {
-            throw new BuildException( "You must not specify multiple <pom> elements" );
-        }
-        this.pom = pom;
-    }
-
-    public void setPomRef( Reference ref )
-    {
-        if ( this.pom != null )
-        {
-            throw new BuildException( "You must not specify multiple <pom> elements" );
-        }
-        pom = new Pom();
-        pom.setProject( getProject() );
-        pom.setRefid( ref );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractResolvingTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractResolvingTask.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractResolvingTask.java
deleted file mode 100644
index b7f0bc3..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/AbstractResolvingTask.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.maven.aether.internal.ant.types.Dependencies;
-import org.apache.maven.aether.internal.ant.types.LocalRepository;
-import org.apache.maven.aether.internal.ant.types.RemoteRepositories;
-import org.apache.maven.aether.internal.ant.types.RemoteRepository;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Reference;
-import org.eclipse.aether.collection.CollectResult;
-
-/**
- */
-public abstract class AbstractResolvingTask
-    extends Task
-{
-
-    protected Dependencies dependencies;
-
-    protected RemoteRepositories remoteRepositories;
-
-    protected LocalRepository localRepository;
-
-    public void addDependencies( Dependencies dependencies )
-    {
-        if ( this.dependencies != null )
-        {
-            throw new BuildException( "You must not specify multiple <dependencies> elements" );
-        }
-        this.dependencies = dependencies;
-    }
-
-    public void setDependenciesRef( Reference ref )
-    {
-        if ( dependencies == null )
-        {
-            dependencies = new Dependencies();
-            dependencies.setProject( getProject() );
-        }
-        dependencies.setRefid( ref );
-    }
-
-    public LocalRepository createLocalRepo()
-    {
-        if ( localRepository != null )
-        {
-            throw new BuildException( "You must not specify multiple <localRepo> elements" );
-        }
-        localRepository = new LocalRepository( this );
-        return localRepository;
-    }
-
-    private RemoteRepositories getRemoteRepos()
-    {
-        if ( remoteRepositories == null )
-        {
-            remoteRepositories = new RemoteRepositories();
-            remoteRepositories.setProject( getProject() );
-        }
-        return remoteRepositories;
-    }
-
-    public void addRemoteRepo( RemoteRepository repository )
-    {
-        getRemoteRepos().addRemoterepo( repository );
-    }
-
-    public void addRemoteRepos( RemoteRepositories repositories )
-    {
-        getRemoteRepos().addRemoterepos( repositories );
-    }
-
-    public void setRemoteReposRef( Reference ref )
-    {
-        RemoteRepositories repos = new RemoteRepositories();
-        repos.setProject( getProject() );
-        repos.setRefid( ref );
-        getRemoteRepos().addRemoterepos( repos );
-    }
-
-    protected CollectResult collectDependencies()
-    {
-        return AntRepoSys.getInstance( getProject() ).collectDependencies( this, dependencies, localRepository,
-                                                                           remoteRepositories );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/DependencyGraphLogger.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/DependencyGraphLogger.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/DependencyGraphLogger.java
deleted file mode 100644
index 24e5b75..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/DependencyGraphLogger.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.graph.DependencyVisitor;
-import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
-
-/**
- */
-class DependencyGraphLogger
-    implements DependencyVisitor
-{
-
-    private Task task;
-
-    private String indent = "";
-
-    public DependencyGraphLogger( Task task )
-    {
-        this.task = task;
-    }
-
-    public boolean visitEnter( DependencyNode node )
-    {
-        StringBuilder buffer = new StringBuilder( 128 );
-        buffer.append( indent );
-        Dependency dep = node.getDependency();
-        if ( dep != null )
-        {
-            Artifact art = dep.getArtifact();
-
-            buffer.append( art );
-            buffer.append( ':' ).append( dep.getScope() );
-
-            String premanagedScope = DependencyManagerUtils.getPremanagedScope( node );
-            if ( premanagedScope != null && !premanagedScope.equals( dep.getScope() ) )
-            {
-                buffer.append( " (scope managed from " ).append( premanagedScope ).append( ")" );
-            }
-
-            String premanagedVersion = DependencyManagerUtils.getPremanagedVersion( node );
-            if ( premanagedVersion != null && !premanagedVersion.equals( art.getVersion() ) )
-            {
-                buffer.append( " (version managed from " ).append( premanagedVersion ).append( ")" );
-            }
-        }
-        else
-        {
-            buffer.append( "Resolved Dependency Graph:" );
-        }
-
-        task.log( buffer.toString(), Project.MSG_VERBOSE );
-        indent += "   ";
-        return true;
-    }
-
-    public boolean visitLeave( DependencyNode node )
-    {
-        indent = indent.substring( 0, indent.length() - 3 );
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/Deploy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Deploy.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/Deploy.java
deleted file mode 100644
index 28b0210..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Deploy.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.maven.aether.internal.ant.types.RemoteRepository;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Deploy
-    extends AbstractDistTask
-{
-
-    private RemoteRepository repository;
-
-    private RemoteRepository snapshotRepository;
-
-    @Override
-    protected void validate()
-    {
-        super.validate();
-
-        if ( repository == null )
-        {
-            throw new BuildException( "You must specify the <remoteRepo id=\"...\" url=\"...\"> element"
-                + " to denote the target repository for the deployment" );
-        }
-        else
-        {
-            repository.validate( this );
-        }
-        if ( snapshotRepository != null )
-        {
-            snapshotRepository.validate( this );
-        }
-    }
-
-    public void addRemoteRepo( RemoteRepository repository )
-    {
-        if ( this.repository != null )
-        {
-            throw new BuildException( "You must not specify multiple <remoteRepo> elements" );
-        }
-        this.repository = repository;
-    }
-
-    public void setRemoteRepoRef( Reference ref )
-    {
-        if ( repository == null )
-        {
-            repository = new RemoteRepository();
-            repository.setProject( getProject() );
-        }
-        repository.setRefid( ref );
-    }
-
-    public void addSnapshotRepo( RemoteRepository snapshotRepository )
-    {
-        if ( this.snapshotRepository != null )
-        {
-            throw new BuildException( "You must not specify multiple <snapshotRepo> elements" );
-        }
-        this.snapshotRepository = snapshotRepository;
-    }
-
-    public void setSnapshotRepoRef( Reference ref )
-    {
-        if ( snapshotRepository == null )
-        {
-            snapshotRepository = new RemoteRepository();
-            snapshotRepository.setProject( getProject() );
-        }
-        snapshotRepository.setRefid( ref );
-    }
-
-    @Override
-    public void execute()
-        throws BuildException
-    {
-        validate();
-
-        AntRepoSys.getInstance( getProject() ).deploy( this, getPom(), getArtifacts(), repository, snapshotRepository );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/Install.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Install.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/Install.java
deleted file mode 100644
index e94b433..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Install.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 org.apache.maven.aether.internal.ant.AntRepoSys;
-
-/*
- * 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 org.apache.tools.ant.BuildException;
-
-/**
- */
-public class Install
-    extends AbstractDistTask
-{
-
-    @Override
-    public void execute()
-        throws BuildException
-    {
-        validate();
-
-        AntRepoSys.getInstance( getProject() ).install( this, getPom(), getArtifacts() );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/Layout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Layout.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/Layout.java
deleted file mode 100644
index 6d70794..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Layout.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.eclipse.aether.artifact.Artifact;
-
-/**
- */
-class Layout
-{
-
-    public static final String GID = "{groupId}";
-
-    public static final String GID_DIRS = "{groupIdDirs}";
-
-    public static final String AID = "{artifactId}";
-
-    public static final String VER = "{version}";
-
-    public static final String BVER = "{baseVersion}";
-
-    public static final String EXT = "{extension}";
-
-    public static final String CLS = "{classifier}";
-
-    private String[] tokens;
-
-    public Layout( String layout )
-        throws BuildException
-    {
-        Collection<String> valid = new HashSet<String>( Arrays.asList( GID, GID_DIRS, AID, VER, BVER, EXT, CLS ) );
-        List<String> tokens = new ArrayList<String>();
-        Matcher m = Pattern.compile( "(\\{[^}]*\\})|([^{]+)" ).matcher( layout );
-        while ( m.find() )
-        {
-            if ( m.group( 1 ) != null && !valid.contains( m.group( 1 ) ) )
-            {
-                throw new BuildException( "Invalid variable '" + m.group() + "' in layout, supported variables are "
-                    + new TreeSet<String>( valid ) );
-            }
-            tokens.add( m.group() );
-        }
-        this.tokens = tokens.toArray( new String[tokens.size()] );
-    }
-
-    public String getPath( Artifact artifact )
-    {
-        StringBuilder buffer = new StringBuilder( 128 );
-
-        for ( int i = 0; i < tokens.length; i++ )
-        {
-            String token = tokens[i];
-            if ( GID.equals( token ) )
-            {
-                buffer.append( artifact.getGroupId() );
-            }
-            else if ( GID_DIRS.equals( token ) )
-            {
-                buffer.append( artifact.getGroupId().replace( '.', '/' ) );
-            }
-            else if ( AID.equals( token ) )
-            {
-                buffer.append( artifact.getArtifactId() );
-            }
-            else if ( VER.equals( token ) )
-            {
-                buffer.append( artifact.getVersion() );
-            }
-            else if ( BVER.equals( token ) )
-            {
-                buffer.append( artifact.getBaseVersion() );
-            }
-            else if ( CLS.equals( token ) )
-            {
-                if ( artifact.getClassifier().length() <= 0 )
-                {
-                    if ( i > 0 )
-                    {
-                        String lt = tokens[i - 1];
-                        if ( lt.length() > 0 && "-_".indexOf( lt.charAt( lt.length() - 1 ) ) >= 0 )
-                        {
-                            buffer.setLength( buffer.length() - 1 );
-                        }
-                    }
-                }
-                else
-                {
-                    buffer.append( artifact.getClassifier() );
-                }
-            }
-            else if ( EXT.equals( token ) )
-            {
-                buffer.append( artifact.getExtension() );
-            }
-            else
-            {
-                buffer.append( token );
-            }
-        }
-
-        return buffer.toString();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/RefTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/RefTask.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/RefTask.java
deleted file mode 100644
index 197066e..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/RefTask.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.ComponentHelper;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public abstract class RefTask
-    extends Task
-{
-
-    private Reference ref;
-
-    public boolean isReference()
-    {
-        return ref != null;
-    }
-
-    public void setRefid( final Reference ref )
-    {
-        this.ref = ref;
-    }
-
-    protected void checkAttributesAllowed()
-    {
-        if ( isReference() )
-        {
-            throw tooManyAttributes();
-        }
-    }
-
-    protected void checkChildrenAllowed()
-    {
-        if ( isReference() )
-        {
-            throw noChildrenAllowed();
-        }
-    }
-
-    protected BuildException tooManyAttributes()
-    {
-        return new BuildException( "You must not specify more than one " + "attribute when using refid" );
-    }
-
-    protected BuildException noChildrenAllowed()
-    {
-        return new BuildException( "You must not specify nested elements " + "when using refid" );
-    }
-
-    protected String getDataTypeName()
-    {
-        return ComponentHelper.getElementName( getProject(), this, true );
-    }
-
-    protected Object getCheckedRef()
-    {
-        return getCheckedRef( getClass(), getDataTypeName(), getProject() );
-    }
-
-    protected Object getCheckedRef( final Class<?> requiredClass, final String dataTypeName, final Project project )
-    {
-        if ( project == null )
-        {
-            throw new BuildException( "No Project specified" );
-        }
-        Object o = ref.getReferencedObject( project );
-        if ( !( requiredClass.isAssignableFrom( o.getClass() ) ) )
-        {
-            log( "Class " + o.getClass() + " is not a subclass of " + requiredClass, Project.MSG_VERBOSE );
-            String msg = ref.getRefId() + " doesn\'t denote a " + dataTypeName;
-            throw new BuildException( msg );
-        }
-        return o;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/tasks/Resolve.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Resolve.java b/src/main/java/org/apache/maven/aether/internal/ant/tasks/Resolve.java
deleted file mode 100644
index 7e2deae..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/tasks/Resolve.java
+++ /dev/null
@@ -1,585 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.maven.aether.internal.ant.Names;
-import org.apache.maven.aether.internal.ant.types.Dependencies;
-import org.apache.maven.aether.internal.ant.types.Pom;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectComponent;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Reference;
-import org.apache.tools.ant.types.resources.FileResource;
-import org.apache.tools.ant.types.resources.Resources;
-import org.apache.tools.ant.util.FileUtils;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.graph.DependencyFilter;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.util.artifact.SubArtifact;
-import org.eclipse.aether.util.filter.ScopeDependencyFilter;
-
-/**
- */
-public class Resolve
-    extends AbstractResolvingTask
-{
-
-    private List<ArtifactConsumer> consumers = new ArrayList<ArtifactConsumer>();
-
-    private boolean failOnMissingAttachments;
-
-    public void setFailOnMissingAttachments( boolean failOnMissingAttachments )
-    {
-        this.failOnMissingAttachments = failOnMissingAttachments;
-    }
-
-    public Path createPath()
-    {
-        Path path = new Path();
-        consumers.add( path );
-        return path;
-    }
-
-    public Files createFiles()
-    {
-        Files files = new Files();
-        consumers.add( files );
-        return files;
-    }
-
-    public Props createProperties()
-    {
-        Props props = new Props();
-        consumers.add( props );
-        return props;
-    }
-
-    private void validate()
-    {
-        for ( ArtifactConsumer consumer : consumers )
-        {
-            consumer.validate();
-        }
-
-        Pom pom = AntRepoSys.getInstance( getProject() ).getDefaultPom();
-        if ( dependencies == null && pom != null )
-        {
-            log( "Using default pom for dependency resolution (" + pom.toString() + ")", Project.MSG_INFO );
-            dependencies = new Dependencies();
-            dependencies.setProject( getProject() );
-            getProject().addReference( Names.ID_DEFAULT_POM, pom );
-            dependencies.setPomRef( new Reference( getProject(), Names.ID_DEFAULT_POM ) );
-        }
-
-        if ( dependencies != null )
-        {
-            dependencies.validate( this );
-        }
-        else
-        {
-            throw new BuildException( "No <dependencies> set for resolution" );
-        }
-    }
-
-    @Override
-    public void execute()
-        throws BuildException
-    {
-        validate();
-
-
-        AntRepoSys sys = AntRepoSys.getInstance( getProject() );
-
-        RepositorySystemSession session = sys.getSession( this, localRepository );
-        RepositorySystem system = sys.getSystem();
-        log( "Using local repository " + session.getLocalRepository(), Project.MSG_VERBOSE );
-
-        DependencyNode root = collectDependencies().getRoot();
-        root.accept( new DependencyGraphLogger( this ) );
-
-        Map<String, Group> groups = new HashMap<String, Group>();
-        for ( ArtifactConsumer consumer : consumers )
-        {
-            String classifier = consumer.getClassifier();
-            Group group = groups.get( classifier );
-            if ( group == null )
-            {
-                group = new Group( classifier );
-                groups.put( classifier, group );
-            }
-            group.add( consumer );
-        }
-
-        for ( Group group : groups.values() )
-        {
-            group.createRequests( root );
-        }
-
-        log( "Resolving artifacts", Project.MSG_INFO );
-
-        for ( Group group : groups.values() )
-        {
-            List<ArtifactResult> results;
-            try
-            {
-                results = system.resolveArtifacts( session, group.getRequests() );
-            }
-            catch ( ArtifactResolutionException e )
-            {
-                if ( !group.isAttachments() || failOnMissingAttachments )
-                {
-                    throw new BuildException( "Could not resolve artifacts: " + e.getMessage(), e );
-                }
-                results = e.getResults();
-                for ( ArtifactResult result : results )
-                {
-                    if ( result.isMissing() )
-                    {
-                        log( "Ignoring missing attachment " + result.getRequest().getArtifact(), Project.MSG_VERBOSE );
-                    }
-                    else if ( !result.isResolved() )
-                    {
-                        throw new BuildException( "Could not resolve artifacts: " + e.getMessage(), e );
-                    }
-                }
-            }
-
-            group.processResults( results, session );
-        }
-    }
-
-    /**
-     */
-    public abstract static class ArtifactConsumer
-        extends ProjectComponent
-    {
-
-        private DependencyFilter filter;
-
-        public boolean accept( org.eclipse.aether.graph.DependencyNode node, List<DependencyNode> parents )
-        {
-            return filter == null || filter.accept( node, parents );
-        }
-
-        public String getClassifier()
-        {
-            return null;
-        }
-
-        public void validate()
-        {
-
-        }
-
-        public abstract void process( Artifact artifact, RepositorySystemSession session );
-
-        public void setScopes( String scopes )
-        {
-            if ( filter != null )
-            {
-                throw new BuildException( "You must not specify both 'scopes' and 'classpath'" );
-            }
-
-            Collection<String> included = new HashSet<String>();
-            Collection<String> excluded = new HashSet<String>();
-
-            String[] split = scopes.split( "[, ]" );
-            for ( String scope : split )
-            {
-                scope = scope.trim();
-                Collection<String> dst;
-                if ( scope.startsWith( "-" ) || scope.startsWith( "!" ) )
-                {
-                    dst = excluded;
-                    scope = scope.substring( 1 );
-                }
-                else
-                {
-                    dst = included;
-                }
-                if ( scope.length() > 0 )
-                {
-                    dst.add( scope );
-                }
-            }
-
-            filter = new ScopeDependencyFilter( included, excluded );
-        }
-
-        public void setClasspath( String classpath )
-        {
-            if ( "compile".equals( classpath ) )
-            {
-                setScopes( "provided,system,compile" );
-            }
-            else if ( "runtime".equals( classpath ) )
-            {
-                setScopes( "compile,runtime" );
-            }
-            else if ( "test".equals( classpath ) )
-            {
-                setScopes( "provided,system,compile,runtime,test" );
-            }
-            else
-            {
-                throw new BuildException( "The classpath '" + classpath + "' is not defined"
-                    + ", must be one of 'compile', 'runtime' or 'test'" );
-            }
-        }
-
-    }
-
-    /**
-     */
-    public class Path
-        extends ArtifactConsumer
-    {
-
-        private String refid;
-
-        private org.apache.tools.ant.types.Path path;
-
-        public void setRefId( String refId )
-        {
-            this.refid = refId;
-        }
-
-        public void validate()
-        {
-            if ( refid == null )
-            {
-                throw new BuildException( "You must specify the 'refid' for the path" );
-            }
-        }
-
-        public void process( Artifact artifact, RepositorySystemSession session )
-        {
-            if ( path == null )
-            {
-                path = new org.apache.tools.ant.types.Path( getProject() );
-                getProject().addReference( refid, path );
-            }
-            path.setLocation( artifact.getFile() );
-        }
-
-    }
-
-    /**
-     */
-    public class Files
-        extends ArtifactConsumer
-    {
-
-        private static final String DEFAULT_LAYOUT = Layout.GID_DIRS + "/" + Layout.AID + "/" + Layout.BVER + "/"
-            + Layout.AID + "-" + Layout.VER + "-" + Layout.CLS + "." + Layout.EXT;
-
-        private String refid;
-
-        private String classifier;
-
-        private File dir;
-
-        private Layout layout;
-
-        private FileSet fileset;
-
-        private Resources resources;
-
-        public void setRefId( String refId )
-        {
-            this.refid = refId;
-        }
-
-        public String getClassifier()
-        {
-            return classifier;
-        }
-
-        public void setAttachments( String attachments )
-        {
-            if ( "sources".equals( attachments ) )
-            {
-                classifier = "*-sources";
-            }
-            else if ( "javadoc".equals( attachments ) )
-            {
-                classifier = "*-javadoc";
-            }
-            else
-            {
-                throw new BuildException( "The attachment type '" + attachments
-                    + "' is not defined, must be one of 'sources' or 'javadoc'" );
-            }
-        }
-
-        public void setDir( File dir )
-        {
-            this.dir = dir;
-            if ( dir != null && layout == null )
-            {
-                layout = new Layout( DEFAULT_LAYOUT );
-            }
-        }
-
-        public void setLayout( String layout )
-        {
-            this.layout = new Layout( layout );
-        }
-
-        public void validate()
-        {
-            if ( refid == null && dir == null )
-            {
-                throw new BuildException( "You must either specify the 'refid' for the resource collection"
-                    + " or a 'dir' to copy the files to" );
-            }
-            if ( dir == null && layout != null )
-            {
-                throw new BuildException( "You must not specify a 'layout' unless 'dir' is also specified" );
-            }
-        }
-
-        public void process( Artifact artifact, RepositorySystemSession session )
-        {
-            if ( dir != null )
-            {
-                if ( refid != null && fileset == null )
-                {
-                    fileset = new FileSet();
-                    fileset.setProject( getProject() );
-                    fileset.setDir( dir );
-                    getProject().addReference( refid, fileset );
-                }
-
-                String path = layout.getPath( artifact );
-
-                if ( fileset != null )
-                {
-                    fileset.createInclude().setName( path );
-                }
-
-                File src = artifact.getFile();
-                File dst = new File( dir, path );
-
-                if ( src.lastModified() != dst.lastModified() || src.length() != dst.length() )
-                {
-                    try
-                    {
-                        Resolve.this.log( "Copy " + src + " to " + dst, Project.MSG_VERBOSE );
-                        FileUtils.getFileUtils().copyFile( src, dst, null, true, true );
-                    }
-                    catch ( IOException e )
-                    {
-                        throw new BuildException( "Failed to copy artifact file " + src + " to " + dst + ": "
-                            + e.getMessage(), e );
-                    }
-                }
-                else
-                {
-                    Resolve.this.log( "Omit to copy " + src + " to " + dst + ", seems unchanged", Project.MSG_VERBOSE );
-                }
-            }
-            else
-            {
-                if ( resources == null )
-                {
-                    resources = new Resources();
-                    resources.setProject( getProject() );
-                    getProject().addReference( refid, resources );
-                }
-
-                FileResource resource = new FileResource( artifact.getFile() );
-                resource.setBaseDir( session.getLocalRepository().getBasedir() );
-                resource.setProject( getProject() );
-                resources.add( resource );
-            }
-        }
-
-    }
-
-    /**
-     */
-    public class Props
-        extends ArtifactConsumer
-    {
-
-        private String prefix;
-
-        private String classifier;
-
-        public void setPrefix( String prefix )
-        {
-            this.prefix = prefix;
-        }
-
-        public String getClassifier()
-        {
-            return classifier;
-        }
-
-        public void setAttachments( String attachments )
-        {
-            if ( "sources".equals( attachments ) )
-            {
-                classifier = "*-sources";
-            }
-            else if ( "javadoc".equals( attachments ) )
-            {
-                classifier = "*-javadoc";
-            }
-            else
-            {
-                throw new BuildException( "The attachment type '" + attachments
-                    + "' is not defined, must be one of 'sources' or 'javadoc'" );
-            }
-        }
-
-        public void process( Artifact artifact, RepositorySystemSession session )
-        {
-            StringBuilder buffer = new StringBuilder( 256 );
-            if ( prefix != null && prefix.length() > 0 )
-            {
-                buffer.append( prefix );
-                if ( !prefix.endsWith( "." ) )
-                {
-                    buffer.append( '.' );
-                }
-            }
-            buffer.append( artifact.getGroupId() );
-            buffer.append( ':' );
-            buffer.append( artifact.getArtifactId() );
-            buffer.append( ':' );
-            buffer.append( artifact.getExtension() );
-            if ( artifact.getClassifier().length() > 0 )
-            {
-                buffer.append( ':' );
-                buffer.append( artifact.getClassifier() );
-            }
-
-            String path = artifact.getFile().getAbsolutePath();
-
-            getProject().setProperty( buffer.toString(), path );
-        }
-
-    }
-
-    private static class Group
-    {
-
-        private String classifier;
-
-        private List<ArtifactConsumer> consumers = new ArrayList<ArtifactConsumer>();
-
-        private List<ArtifactRequest> requests = new ArrayList<ArtifactRequest>();
-
-        public Group( String classifier )
-        {
-            this.classifier = classifier;
-        }
-
-        public boolean isAttachments()
-        {
-            return classifier != null;
-        }
-
-        public void add( ArtifactConsumer consumer )
-        {
-            consumers.add( consumer );
-        }
-
-        public void createRequests( DependencyNode node )
-        {
-            createRequests( node, new LinkedList<DependencyNode>() );
-        }
-
-        private void createRequests( DependencyNode node, LinkedList<DependencyNode> parents )
-        {
-            if ( node.getDependency() != null )
-            {
-                for ( ArtifactConsumer consumer : consumers )
-                {
-                    if ( consumer.accept( node, parents ) )
-                    {
-                        ArtifactRequest request = new ArtifactRequest( node );
-                        if ( classifier != null )
-                        {
-                            request.setArtifact( new SubArtifact( request.getArtifact(), classifier, "jar" ) );
-                        }
-                        requests.add( request );
-                        break;
-                    }
-                }
-            }
-
-            parents.addFirst( node );
-
-            for ( DependencyNode child : node.getChildren() )
-            {
-                createRequests( child, parents );
-            }
-
-            parents.removeFirst();
-        }
-
-        public List<ArtifactRequest> getRequests()
-        {
-            return requests;
-        }
-
-        public void processResults( List<ArtifactResult> results, RepositorySystemSession session )
-        {
-            for ( ArtifactResult result : results )
-            {
-                if ( !result.isResolved() )
-                {
-                    continue;
-                }
-                for ( ArtifactConsumer consumer : consumers )
-                {
-                    if ( consumer.accept( result.getRequest().getDependencyNode(),
-                                          Collections.<DependencyNode>emptyList() ) )
-                    {
-                        consumer.process( result.getArtifact(), session );
-                    }
-                }
-            }
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Artifact.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Artifact.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Artifact.java
deleted file mode 100644
index abd3991..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Artifact.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.maven.aether.internal.ant.ProjectWorkspaceReader;
-import org.apache.maven.aether.internal.ant.tasks.RefTask;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Artifact
-    extends RefTask
-    implements ArtifactContainer
-{
-
-    private File file;
-
-    private String type;
-
-    private String classifier;
-
-    private Pom pom;
-
-    protected Artifact getRef()
-    {
-        return (Artifact) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            if ( file == null )
-            {
-                throw new BuildException( "You must specify the 'file' for the artifact" );
-            }
-            else if ( !file.isFile() )
-            {
-                throw new BuildException( "The artifact file " + file + " does not exist" );
-            }
-            if ( type == null || type.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'type' for the artifact" );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( file != null || type != null || classifier != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public File getFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getFile();
-        }
-        return file;
-    }
-
-    public void setFile( File file )
-    {
-        checkAttributesAllowed();
-        this.file = file;
-
-        if ( file != null && type == null )
-        {
-            String name = file.getName();
-            int period = name.lastIndexOf( '.' );
-            if ( period >= 0 )
-            {
-                type = name.substring( period + 1 );
-            }
-        }
-    }
-
-    public String getType()
-    {
-        if ( isReference() )
-        {
-            return getRef().getType();
-        }
-        return ( type != null ) ? type : "jar";
-    }
-
-    public void setType( String type )
-    {
-        checkAttributesAllowed();
-        this.type = type;
-    }
-
-    public String getClassifier()
-    {
-        if ( isReference() )
-        {
-            return getRef().getClassifier();
-        }
-        return ( classifier != null ) ? classifier : "";
-    }
-
-    public void setClassifier( String classifier )
-    {
-        checkAttributesAllowed();
-        this.classifier = classifier;
-    }
-
-    public void setPomRef( Reference ref )
-    {
-        checkAttributesAllowed();
-        Pom pom = new Pom();
-        pom.setProject( getProject() );
-        pom.setRefid( ref );
-        this.pom = pom;
-    }
-
-    public void addPom( Pom pom )
-    {
-        checkChildrenAllowed();
-        this.pom = pom;
-    }
-
-    public Pom getPom()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPom();
-        }
-        return pom;
-    }
-
-    public List<Artifact> getArtifacts()
-    {
-        return Collections.singletonList( this );
-    }
-
-    @Override
-    public void execute()
-        throws BuildException
-    {
-        ProjectWorkspaceReader.getInstance().addArtifact( this );
-    }
-
-    public String toString()
-    {
-        String pomRepr = getPom() != null ? "(" + getPom().toString() + ":)" : "";
-        return String.format( pomRepr + "%s:%s", getType(), getClassifier() );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/ArtifactContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/ArtifactContainer.java b/src/main/java/org/apache/maven/aether/internal/ant/types/ArtifactContainer.java
deleted file mode 100644
index aad607c..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/ArtifactContainer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.List;
-
-import org.apache.tools.ant.Task;
-
-/**
- */
-public interface ArtifactContainer
-{
-
-    void validate( Task task );
-
-    List<Artifact> getArtifacts();
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Artifacts.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Artifacts.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Artifacts.java
deleted file mode 100644
index 6e75468..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Artifacts.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Artifacts
-    extends DataType
-    implements ArtifactContainer
-{
-
-    private List<ArtifactContainer> containers = new ArrayList<ArtifactContainer>();
-
-    protected Artifacts getRef()
-    {
-        return (Artifacts) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            for ( ArtifactContainer container : containers )
-            {
-                container.validate( task );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( !containers.isEmpty() )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public void addArtifact( Artifact artifact )
-    {
-        checkChildrenAllowed();
-        containers.add( artifact );
-    }
-
-    public void addArtifacts( Artifacts artifacts )
-    {
-        checkChildrenAllowed();
-        if ( artifacts == this )
-        {
-            throw circularReference();
-        }
-        containers.add( artifacts );
-    }
-
-    public List<Artifact> getArtifacts()
-    {
-        if ( isReference() )
-        {
-            return getRef().getArtifacts();
-        }
-        List<Artifact> artifacts = new ArrayList<Artifact>();
-        for ( ArtifactContainer container : containers )
-        {
-            artifacts.addAll( container.getArtifacts() );
-        }
-        return artifacts;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Authentication.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Authentication.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Authentication.java
deleted file mode 100644
index d5356a1..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Authentication.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Authentication
-    extends DataType
-{
-
-    private String username;
-
-    private String password;
-
-    private String privateKeyFile;
-
-    private String passphrase;
-
-    private List<String> servers = new ArrayList<String>();
-
-    @Override
-    public void setProject( Project project )
-    {
-        super.setProject( project );
-
-        AntRepoSys.getInstance( project ).addAuthentication( this );
-    }
-
-    protected Authentication getRef()
-    {
-        return (Authentication) getCheckedRef();
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( username != null || password != null || privateKeyFile != null || passphrase != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getUsername()
-    {
-        if ( isReference() )
-        {
-            return getRef().getUsername();
-        }
-        return username;
-    }
-
-    public void setUsername( String username )
-    {
-        checkAttributesAllowed();
-        this.username = username;
-    }
-
-    public String getPassword()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPassword();
-        }
-        return password;
-    }
-
-    public void setPassword( String password )
-    {
-        checkAttributesAllowed();
-        this.password = password;
-    }
-
-    public String getPrivateKeyFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPrivateKeyFile();
-        }
-        return privateKeyFile;
-    }
-
-    public void setPrivateKeyFile( String privateKeyFile )
-    {
-        checkAttributesAllowed();
-        this.privateKeyFile = privateKeyFile;
-    }
-
-    public String getPassphrase()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPassphrase();
-        }
-        return passphrase;
-    }
-
-    public void setPassphrase( String passphrase )
-    {
-        checkAttributesAllowed();
-        this.passphrase = passphrase;
-    }
-
-    public List<String> getServers()
-    {
-        if ( isReference() )
-        {
-            return getRef().getServers();
-        }
-        return servers;
-    }
-
-    public void setServers( String servers )
-    {
-        checkAttributesAllowed();
-        this.servers.clear();
-        String[] split = servers.split( "[;:]" );
-        for ( String server : split )
-        {
-            server = server.trim();
-            if ( server.length() > 0 )
-            {
-                this.servers.add( server );
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Dependencies.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Dependencies.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Dependencies.java
deleted file mode 100644
index 682da97..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Dependencies.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Dependencies
-    extends DataType
-    implements DependencyContainer
-{
-
-    private File file;
-
-    private Pom pom;
-
-    private List<DependencyContainer> containers = new ArrayList<DependencyContainer>();
-
-    private List<Exclusion> exclusions = new ArrayList<Exclusion>();
-
-    private boolean nestedDependencies;
-
-    protected Dependencies getRef()
-    {
-        return (Dependencies) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            if ( getPom() != null && getPom().getFile() == null )
-            {
-                throw new BuildException( "A <pom> used for dependency resolution has to be backed by a pom.xml file" );
-            }
-            Map<String, String> ids = new HashMap<String, String>();
-            for ( DependencyContainer container : containers )
-            {
-                container.validate( task );
-                if ( container instanceof Dependency )
-                {
-                    Dependency dependency = (Dependency) container;
-                    String id = dependency.getVersionlessKey();
-                    String collision = ids.put( id, dependency.getVersion() );
-                    if ( collision != null )
-                    {
-                        throw new BuildException( "You must not declare multiple <dependency> elements"
-                            + " with the same coordinates but got " + id + " -> " + collision + " vs "
-                            + dependency.getVersion() );
-                    }
-                }
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( pom != null || !exclusions.isEmpty() || !containers.isEmpty() )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public void setFile( File file )
-    {
-        checkAttributesAllowed();
-        this.file = file;
-        checkExternalSources();
-    }
-
-    public File getFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getFile();
-        }
-        return file;
-    }
-
-    public void addPom( Pom pom )
-    {
-        checkChildrenAllowed();
-        if ( this.pom != null )
-        {
-            throw new BuildException( "You must not specify multiple <pom> elements" );
-        }
-        this.pom = pom;
-        checkExternalSources();
-    }
-
-    public Pom getPom()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPom();
-        }
-        return pom;
-    }
-
-    public void setPomRef( Reference ref )
-    {
-        if ( pom == null )
-        {
-            pom = new Pom();
-            pom.setProject( getProject() );
-        }
-        pom.setRefid( ref );
-        checkExternalSources();
-    }
-
-    private void checkExternalSources()
-    {
-        if ( file != null && pom != null )
-        {
-            throw new BuildException( "You must not specify both a text file and a POM to list dependencies" );
-        }
-        if ( ( file != null || pom != null ) && nestedDependencies )
-        {
-            throw new BuildException( "You must not specify both a file/POM and nested dependency collections" );
-        }
-    }
-
-    public void addDependency( Dependency dependency )
-    {
-        checkChildrenAllowed();
-        containers.add( dependency );
-    }
-
-    public void addDependencies( Dependencies dependencies )
-    {
-        checkChildrenAllowed();
-        if ( dependencies == this )
-        {
-            throw circularReference();
-        }
-        containers.add( dependencies );
-        nestedDependencies = true;
-        checkExternalSources();
-    }
-
-    public List<DependencyContainer> getDependencyContainers()
-    {
-        if ( isReference() )
-        {
-            return getRef().getDependencyContainers();
-        }
-        return containers;
-    }
-
-    public void addExclusion( Exclusion exclusion )
-    {
-        checkChildrenAllowed();
-        this.exclusions.add( exclusion );
-    }
-
-    public List<Exclusion> getExclusions()
-    {
-        if ( isReference() )
-        {
-            return getRef().getExclusions();
-        }
-        return exclusions;
-    }
-
-}


[3/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Install.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Install.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Install.java
new file mode 100644
index 0000000..b79716b
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Install.java
@@ -0,0 +1,41 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 org.apache.maven.resolver.internal.ant.AntRepoSys;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ */
+public class Install
+    extends AbstractDistTask
+{
+
+    @Override
+    public void execute()
+        throws BuildException
+    {
+        validate();
+
+        AntRepoSys.getInstance( getProject() ).install( this, getPom(), getArtifacts() );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Layout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Layout.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Layout.java
new file mode 100644
index 0000000..995c00f
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Layout.java
@@ -0,0 +1,131 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.eclipse.aether.artifact.Artifact;
+
+/**
+ */
+class Layout
+{
+
+    public static final String GID = "{groupId}";
+
+    public static final String GID_DIRS = "{groupIdDirs}";
+
+    public static final String AID = "{artifactId}";
+
+    public static final String VER = "{version}";
+
+    public static final String BVER = "{baseVersion}";
+
+    public static final String EXT = "{extension}";
+
+    public static final String CLS = "{classifier}";
+
+    private String[] tokens;
+
+    public Layout( String layout )
+        throws BuildException
+    {
+        Collection<String> valid = new HashSet<String>( Arrays.asList( GID, GID_DIRS, AID, VER, BVER, EXT, CLS ) );
+        List<String> tokens = new ArrayList<String>();
+        Matcher m = Pattern.compile( "(\\{[^}]*\\})|([^{]+)" ).matcher( layout );
+        while ( m.find() )
+        {
+            if ( m.group( 1 ) != null && !valid.contains( m.group( 1 ) ) )
+            {
+                throw new BuildException( "Invalid variable '" + m.group() + "' in layout, supported variables are "
+                    + new TreeSet<String>( valid ) );
+            }
+            tokens.add( m.group() );
+        }
+        this.tokens = tokens.toArray( new String[tokens.size()] );
+    }
+
+    public String getPath( Artifact artifact )
+    {
+        StringBuilder buffer = new StringBuilder( 128 );
+
+        for ( int i = 0; i < tokens.length; i++ )
+        {
+            String token = tokens[i];
+            if ( GID.equals( token ) )
+            {
+                buffer.append( artifact.getGroupId() );
+            }
+            else if ( GID_DIRS.equals( token ) )
+            {
+                buffer.append( artifact.getGroupId().replace( '.', '/' ) );
+            }
+            else if ( AID.equals( token ) )
+            {
+                buffer.append( artifact.getArtifactId() );
+            }
+            else if ( VER.equals( token ) )
+            {
+                buffer.append( artifact.getVersion() );
+            }
+            else if ( BVER.equals( token ) )
+            {
+                buffer.append( artifact.getBaseVersion() );
+            }
+            else if ( CLS.equals( token ) )
+            {
+                if ( artifact.getClassifier().length() <= 0 )
+                {
+                    if ( i > 0 )
+                    {
+                        String lt = tokens[i - 1];
+                        if ( lt.length() > 0 && "-_".indexOf( lt.charAt( lt.length() - 1 ) ) >= 0 )
+                        {
+                            buffer.setLength( buffer.length() - 1 );
+                        }
+                    }
+                }
+                else
+                {
+                    buffer.append( artifact.getClassifier() );
+                }
+            }
+            else if ( EXT.equals( token ) )
+            {
+                buffer.append( artifact.getExtension() );
+            }
+            else
+            {
+                buffer.append( token );
+            }
+        }
+
+        return buffer.toString();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/RefTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/RefTask.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/RefTask.java
new file mode 100644
index 0000000..02e7083
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/RefTask.java
@@ -0,0 +1,98 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.ComponentHelper;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public abstract class RefTask
+    extends Task
+{
+
+    private Reference ref;
+
+    public boolean isReference()
+    {
+        return ref != null;
+    }
+
+    public void setRefid( final Reference ref )
+    {
+        this.ref = ref;
+    }
+
+    protected void checkAttributesAllowed()
+    {
+        if ( isReference() )
+        {
+            throw tooManyAttributes();
+        }
+    }
+
+    protected void checkChildrenAllowed()
+    {
+        if ( isReference() )
+        {
+            throw noChildrenAllowed();
+        }
+    }
+
+    protected BuildException tooManyAttributes()
+    {
+        return new BuildException( "You must not specify more than one " + "attribute when using refid" );
+    }
+
+    protected BuildException noChildrenAllowed()
+    {
+        return new BuildException( "You must not specify nested elements " + "when using refid" );
+    }
+
+    protected String getDataTypeName()
+    {
+        return ComponentHelper.getElementName( getProject(), this, true );
+    }
+
+    protected Object getCheckedRef()
+    {
+        return getCheckedRef( getClass(), getDataTypeName(), getProject() );
+    }
+
+    protected Object getCheckedRef( final Class<?> requiredClass, final String dataTypeName, final Project project )
+    {
+        if ( project == null )
+        {
+            throw new BuildException( "No Project specified" );
+        }
+        Object o = ref.getReferencedObject( project );
+        if ( !( requiredClass.isAssignableFrom( o.getClass() ) ) )
+        {
+            log( "Class " + o.getClass() + " is not a subclass of " + requiredClass, Project.MSG_VERBOSE );
+            String msg = ref.getRefId() + " doesn\'t denote a " + dataTypeName;
+            throw new BuildException( msg );
+        }
+        return o;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Resolve.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Resolve.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Resolve.java
new file mode 100644
index 0000000..da37563
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Resolve.java
@@ -0,0 +1,585 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.maven.resolver.internal.ant.Names;
+import org.apache.maven.resolver.internal.ant.types.Dependencies;
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.resources.Resources;
+import org.apache.tools.ant.util.FileUtils;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.util.artifact.SubArtifact;
+import org.eclipse.aether.util.filter.ScopeDependencyFilter;
+
+/**
+ */
+public class Resolve
+    extends AbstractResolvingTask
+{
+
+    private List<ArtifactConsumer> consumers = new ArrayList<ArtifactConsumer>();
+
+    private boolean failOnMissingAttachments;
+
+    public void setFailOnMissingAttachments( boolean failOnMissingAttachments )
+    {
+        this.failOnMissingAttachments = failOnMissingAttachments;
+    }
+
+    public Path createPath()
+    {
+        Path path = new Path();
+        consumers.add( path );
+        return path;
+    }
+
+    public Files createFiles()
+    {
+        Files files = new Files();
+        consumers.add( files );
+        return files;
+    }
+
+    public Props createProperties()
+    {
+        Props props = new Props();
+        consumers.add( props );
+        return props;
+    }
+
+    private void validate()
+    {
+        for ( ArtifactConsumer consumer : consumers )
+        {
+            consumer.validate();
+        }
+
+        Pom pom = AntRepoSys.getInstance( getProject() ).getDefaultPom();
+        if ( dependencies == null && pom != null )
+        {
+            log( "Using default pom for dependency resolution (" + pom.toString() + ")", Project.MSG_INFO );
+            dependencies = new Dependencies();
+            dependencies.setProject( getProject() );
+            getProject().addReference( Names.ID_DEFAULT_POM, pom );
+            dependencies.setPomRef( new Reference( getProject(), Names.ID_DEFAULT_POM ) );
+        }
+
+        if ( dependencies != null )
+        {
+            dependencies.validate( this );
+        }
+        else
+        {
+            throw new BuildException( "No <dependencies> set for resolution" );
+        }
+    }
+
+    @Override
+    public void execute()
+        throws BuildException
+    {
+        validate();
+
+
+        AntRepoSys sys = AntRepoSys.getInstance( getProject() );
+
+        RepositorySystemSession session = sys.getSession( this, localRepository );
+        RepositorySystem system = sys.getSystem();
+        log( "Using local repository " + session.getLocalRepository(), Project.MSG_VERBOSE );
+
+        DependencyNode root = collectDependencies().getRoot();
+        root.accept( new DependencyGraphLogger( this ) );
+
+        Map<String, Group> groups = new HashMap<String, Group>();
+        for ( ArtifactConsumer consumer : consumers )
+        {
+            String classifier = consumer.getClassifier();
+            Group group = groups.get( classifier );
+            if ( group == null )
+            {
+                group = new Group( classifier );
+                groups.put( classifier, group );
+            }
+            group.add( consumer );
+        }
+
+        for ( Group group : groups.values() )
+        {
+            group.createRequests( root );
+        }
+
+        log( "Resolving artifacts", Project.MSG_INFO );
+
+        for ( Group group : groups.values() )
+        {
+            List<ArtifactResult> results;
+            try
+            {
+                results = system.resolveArtifacts( session, group.getRequests() );
+            }
+            catch ( ArtifactResolutionException e )
+            {
+                if ( !group.isAttachments() || failOnMissingAttachments )
+                {
+                    throw new BuildException( "Could not resolve artifacts: " + e.getMessage(), e );
+                }
+                results = e.getResults();
+                for ( ArtifactResult result : results )
+                {
+                    if ( result.isMissing() )
+                    {
+                        log( "Ignoring missing attachment " + result.getRequest().getArtifact(), Project.MSG_VERBOSE );
+                    }
+                    else if ( !result.isResolved() )
+                    {
+                        throw new BuildException( "Could not resolve artifacts: " + e.getMessage(), e );
+                    }
+                }
+            }
+
+            group.processResults( results, session );
+        }
+    }
+
+    /**
+     */
+    public abstract static class ArtifactConsumer
+        extends ProjectComponent
+    {
+
+        private DependencyFilter filter;
+
+        public boolean accept( org.eclipse.aether.graph.DependencyNode node, List<DependencyNode> parents )
+        {
+            return filter == null || filter.accept( node, parents );
+        }
+
+        public String getClassifier()
+        {
+            return null;
+        }
+
+        public void validate()
+        {
+
+        }
+
+        public abstract void process( Artifact artifact, RepositorySystemSession session );
+
+        public void setScopes( String scopes )
+        {
+            if ( filter != null )
+            {
+                throw new BuildException( "You must not specify both 'scopes' and 'classpath'" );
+            }
+
+            Collection<String> included = new HashSet<String>();
+            Collection<String> excluded = new HashSet<String>();
+
+            String[] split = scopes.split( "[, ]" );
+            for ( String scope : split )
+            {
+                scope = scope.trim();
+                Collection<String> dst;
+                if ( scope.startsWith( "-" ) || scope.startsWith( "!" ) )
+                {
+                    dst = excluded;
+                    scope = scope.substring( 1 );
+                }
+                else
+                {
+                    dst = included;
+                }
+                if ( scope.length() > 0 )
+                {
+                    dst.add( scope );
+                }
+            }
+
+            filter = new ScopeDependencyFilter( included, excluded );
+        }
+
+        public void setClasspath( String classpath )
+        {
+            if ( "compile".equals( classpath ) )
+            {
+                setScopes( "provided,system,compile" );
+            }
+            else if ( "runtime".equals( classpath ) )
+            {
+                setScopes( "compile,runtime" );
+            }
+            else if ( "test".equals( classpath ) )
+            {
+                setScopes( "provided,system,compile,runtime,test" );
+            }
+            else
+            {
+                throw new BuildException( "The classpath '" + classpath + "' is not defined"
+                    + ", must be one of 'compile', 'runtime' or 'test'" );
+            }
+        }
+
+    }
+
+    /**
+     */
+    public class Path
+        extends ArtifactConsumer
+    {
+
+        private String refid;
+
+        private org.apache.tools.ant.types.Path path;
+
+        public void setRefId( String refId )
+        {
+            this.refid = refId;
+        }
+
+        public void validate()
+        {
+            if ( refid == null )
+            {
+                throw new BuildException( "You must specify the 'refid' for the path" );
+            }
+        }
+
+        public void process( Artifact artifact, RepositorySystemSession session )
+        {
+            if ( path == null )
+            {
+                path = new org.apache.tools.ant.types.Path( getProject() );
+                getProject().addReference( refid, path );
+            }
+            path.setLocation( artifact.getFile() );
+        }
+
+    }
+
+    /**
+     */
+    public class Files
+        extends ArtifactConsumer
+    {
+
+        private static final String DEFAULT_LAYOUT = Layout.GID_DIRS + "/" + Layout.AID + "/" + Layout.BVER + "/"
+            + Layout.AID + "-" + Layout.VER + "-" + Layout.CLS + "." + Layout.EXT;
+
+        private String refid;
+
+        private String classifier;
+
+        private File dir;
+
+        private Layout layout;
+
+        private FileSet fileset;
+
+        private Resources resources;
+
+        public void setRefId( String refId )
+        {
+            this.refid = refId;
+        }
+
+        public String getClassifier()
+        {
+            return classifier;
+        }
+
+        public void setAttachments( String attachments )
+        {
+            if ( "sources".equals( attachments ) )
+            {
+                classifier = "*-sources";
+            }
+            else if ( "javadoc".equals( attachments ) )
+            {
+                classifier = "*-javadoc";
+            }
+            else
+            {
+                throw new BuildException( "The attachment type '" + attachments
+                    + "' is not defined, must be one of 'sources' or 'javadoc'" );
+            }
+        }
+
+        public void setDir( File dir )
+        {
+            this.dir = dir;
+            if ( dir != null && layout == null )
+            {
+                layout = new Layout( DEFAULT_LAYOUT );
+            }
+        }
+
+        public void setLayout( String layout )
+        {
+            this.layout = new Layout( layout );
+        }
+
+        public void validate()
+        {
+            if ( refid == null && dir == null )
+            {
+                throw new BuildException( "You must either specify the 'refid' for the resource collection"
+                    + " or a 'dir' to copy the files to" );
+            }
+            if ( dir == null && layout != null )
+            {
+                throw new BuildException( "You must not specify a 'layout' unless 'dir' is also specified" );
+            }
+        }
+
+        public void process( Artifact artifact, RepositorySystemSession session )
+        {
+            if ( dir != null )
+            {
+                if ( refid != null && fileset == null )
+                {
+                    fileset = new FileSet();
+                    fileset.setProject( getProject() );
+                    fileset.setDir( dir );
+                    getProject().addReference( refid, fileset );
+                }
+
+                String path = layout.getPath( artifact );
+
+                if ( fileset != null )
+                {
+                    fileset.createInclude().setName( path );
+                }
+
+                File src = artifact.getFile();
+                File dst = new File( dir, path );
+
+                if ( src.lastModified() != dst.lastModified() || src.length() != dst.length() )
+                {
+                    try
+                    {
+                        Resolve.this.log( "Copy " + src + " to " + dst, Project.MSG_VERBOSE );
+                        FileUtils.getFileUtils().copyFile( src, dst, null, true, true );
+                    }
+                    catch ( IOException e )
+                    {
+                        throw new BuildException( "Failed to copy artifact file " + src + " to " + dst + ": "
+                            + e.getMessage(), e );
+                    }
+                }
+                else
+                {
+                    Resolve.this.log( "Omit to copy " + src + " to " + dst + ", seems unchanged", Project.MSG_VERBOSE );
+                }
+            }
+            else
+            {
+                if ( resources == null )
+                {
+                    resources = new Resources();
+                    resources.setProject( getProject() );
+                    getProject().addReference( refid, resources );
+                }
+
+                FileResource resource = new FileResource( artifact.getFile() );
+                resource.setBaseDir( session.getLocalRepository().getBasedir() );
+                resource.setProject( getProject() );
+                resources.add( resource );
+            }
+        }
+
+    }
+
+    /**
+     */
+    public class Props
+        extends ArtifactConsumer
+    {
+
+        private String prefix;
+
+        private String classifier;
+
+        public void setPrefix( String prefix )
+        {
+            this.prefix = prefix;
+        }
+
+        public String getClassifier()
+        {
+            return classifier;
+        }
+
+        public void setAttachments( String attachments )
+        {
+            if ( "sources".equals( attachments ) )
+            {
+                classifier = "*-sources";
+            }
+            else if ( "javadoc".equals( attachments ) )
+            {
+                classifier = "*-javadoc";
+            }
+            else
+            {
+                throw new BuildException( "The attachment type '" + attachments
+                    + "' is not defined, must be one of 'sources' or 'javadoc'" );
+            }
+        }
+
+        public void process( Artifact artifact, RepositorySystemSession session )
+        {
+            StringBuilder buffer = new StringBuilder( 256 );
+            if ( prefix != null && prefix.length() > 0 )
+            {
+                buffer.append( prefix );
+                if ( !prefix.endsWith( "." ) )
+                {
+                    buffer.append( '.' );
+                }
+            }
+            buffer.append( artifact.getGroupId() );
+            buffer.append( ':' );
+            buffer.append( artifact.getArtifactId() );
+            buffer.append( ':' );
+            buffer.append( artifact.getExtension() );
+            if ( artifact.getClassifier().length() > 0 )
+            {
+                buffer.append( ':' );
+                buffer.append( artifact.getClassifier() );
+            }
+
+            String path = artifact.getFile().getAbsolutePath();
+
+            getProject().setProperty( buffer.toString(), path );
+        }
+
+    }
+
+    private static class Group
+    {
+
+        private String classifier;
+
+        private List<ArtifactConsumer> consumers = new ArrayList<ArtifactConsumer>();
+
+        private List<ArtifactRequest> requests = new ArrayList<ArtifactRequest>();
+
+        public Group( String classifier )
+        {
+            this.classifier = classifier;
+        }
+
+        public boolean isAttachments()
+        {
+            return classifier != null;
+        }
+
+        public void add( ArtifactConsumer consumer )
+        {
+            consumers.add( consumer );
+        }
+
+        public void createRequests( DependencyNode node )
+        {
+            createRequests( node, new LinkedList<DependencyNode>() );
+        }
+
+        private void createRequests( DependencyNode node, LinkedList<DependencyNode> parents )
+        {
+            if ( node.getDependency() != null )
+            {
+                for ( ArtifactConsumer consumer : consumers )
+                {
+                    if ( consumer.accept( node, parents ) )
+                    {
+                        ArtifactRequest request = new ArtifactRequest( node );
+                        if ( classifier != null )
+                        {
+                            request.setArtifact( new SubArtifact( request.getArtifact(), classifier, "jar" ) );
+                        }
+                        requests.add( request );
+                        break;
+                    }
+                }
+            }
+
+            parents.addFirst( node );
+
+            for ( DependencyNode child : node.getChildren() )
+            {
+                createRequests( child, parents );
+            }
+
+            parents.removeFirst();
+        }
+
+        public List<ArtifactRequest> getRequests()
+        {
+            return requests;
+        }
+
+        public void processResults( List<ArtifactResult> results, RepositorySystemSession session )
+        {
+            for ( ArtifactResult result : results )
+            {
+                if ( !result.isResolved() )
+                {
+                    continue;
+                }
+                for ( ArtifactConsumer consumer : consumers )
+                {
+                    if ( consumer.accept( result.getRequest().getDependencyNode(),
+                                          Collections.<DependencyNode>emptyList() ) )
+                    {
+                        consumer.process( result.getArtifact(), session );
+                    }
+                }
+            }
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifact.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifact.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifact.java
new file mode 100644
index 0000000..7a5d054
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifact.java
@@ -0,0 +1,181 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.resolver.internal.ant.ProjectWorkspaceReader;
+import org.apache.maven.resolver.internal.ant.tasks.RefTask;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Artifact
+    extends RefTask
+    implements ArtifactContainer
+{
+
+    private File file;
+
+    private String type;
+
+    private String classifier;
+
+    private Pom pom;
+
+    protected Artifact getRef()
+    {
+        return (Artifact) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            if ( file == null )
+            {
+                throw new BuildException( "You must specify the 'file' for the artifact" );
+            }
+            else if ( !file.isFile() )
+            {
+                throw new BuildException( "The artifact file " + file + " does not exist" );
+            }
+            if ( type == null || type.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'type' for the artifact" );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( file != null || type != null || classifier != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public File getFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getFile();
+        }
+        return file;
+    }
+
+    public void setFile( File file )
+    {
+        checkAttributesAllowed();
+        this.file = file;
+
+        if ( file != null && type == null )
+        {
+            String name = file.getName();
+            int period = name.lastIndexOf( '.' );
+            if ( period >= 0 )
+            {
+                type = name.substring( period + 1 );
+            }
+        }
+    }
+
+    public String getType()
+    {
+        if ( isReference() )
+        {
+            return getRef().getType();
+        }
+        return ( type != null ) ? type : "jar";
+    }
+
+    public void setType( String type )
+    {
+        checkAttributesAllowed();
+        this.type = type;
+    }
+
+    public String getClassifier()
+    {
+        if ( isReference() )
+        {
+            return getRef().getClassifier();
+        }
+        return ( classifier != null ) ? classifier : "";
+    }
+
+    public void setClassifier( String classifier )
+    {
+        checkAttributesAllowed();
+        this.classifier = classifier;
+    }
+
+    public void setPomRef( Reference ref )
+    {
+        checkAttributesAllowed();
+        Pom pom = new Pom();
+        pom.setProject( getProject() );
+        pom.setRefid( ref );
+        this.pom = pom;
+    }
+
+    public void addPom( Pom pom )
+    {
+        checkChildrenAllowed();
+        this.pom = pom;
+    }
+
+    public Pom getPom()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPom();
+        }
+        return pom;
+    }
+
+    public List<Artifact> getArtifacts()
+    {
+        return Collections.singletonList( this );
+    }
+
+    @Override
+    public void execute()
+        throws BuildException
+    {
+        ProjectWorkspaceReader.getInstance().addArtifact( this );
+    }
+
+    public String toString()
+    {
+        String pomRepr = getPom() != null ? "(" + getPom().toString() + ":)" : "";
+        return String.format( pomRepr + "%s:%s", getType(), getClassifier() );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/ArtifactContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/ArtifactContainer.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/ArtifactContainer.java
new file mode 100644
index 0000000..d447808
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/ArtifactContainer.java
@@ -0,0 +1,35 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.tools.ant.Task;
+
+/**
+ */
+public interface ArtifactContainer
+{
+
+    void validate( Task task );
+
+    List<Artifact> getArtifacts();
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifacts.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifacts.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifacts.java
new file mode 100644
index 0000000..85f8b78
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Artifacts.java
@@ -0,0 +1,97 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Artifacts
+    extends DataType
+    implements ArtifactContainer
+{
+
+    private List<ArtifactContainer> containers = new ArrayList<ArtifactContainer>();
+
+    protected Artifacts getRef()
+    {
+        return (Artifacts) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            for ( ArtifactContainer container : containers )
+            {
+                container.validate( task );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( !containers.isEmpty() )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public void addArtifact( Artifact artifact )
+    {
+        checkChildrenAllowed();
+        containers.add( artifact );
+    }
+
+    public void addArtifacts( Artifacts artifacts )
+    {
+        checkChildrenAllowed();
+        if ( artifacts == this )
+        {
+            throw circularReference();
+        }
+        containers.add( artifacts );
+    }
+
+    public List<Artifact> getArtifacts()
+    {
+        if ( isReference() )
+        {
+            return getRef().getArtifacts();
+        }
+        List<Artifact> artifacts = new ArrayList<Artifact>();
+        for ( ArtifactContainer container : containers )
+        {
+            artifacts.addAll( container.getArtifacts() );
+        }
+        return artifacts;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Authentication.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Authentication.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Authentication.java
new file mode 100644
index 0000000..6d212fc
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Authentication.java
@@ -0,0 +1,152 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Authentication
+    extends DataType
+{
+
+    private String username;
+
+    private String password;
+
+    private String privateKeyFile;
+
+    private String passphrase;
+
+    private List<String> servers = new ArrayList<String>();
+
+    @Override
+    public void setProject( Project project )
+    {
+        super.setProject( project );
+
+        AntRepoSys.getInstance( project ).addAuthentication( this );
+    }
+
+    protected Authentication getRef()
+    {
+        return (Authentication) getCheckedRef();
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( username != null || password != null || privateKeyFile != null || passphrase != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getUsername()
+    {
+        if ( isReference() )
+        {
+            return getRef().getUsername();
+        }
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        checkAttributesAllowed();
+        this.username = username;
+    }
+
+    public String getPassword()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPassword();
+        }
+        return password;
+    }
+
+    public void setPassword( String password )
+    {
+        checkAttributesAllowed();
+        this.password = password;
+    }
+
+    public String getPrivateKeyFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPrivateKeyFile();
+        }
+        return privateKeyFile;
+    }
+
+    public void setPrivateKeyFile( String privateKeyFile )
+    {
+        checkAttributesAllowed();
+        this.privateKeyFile = privateKeyFile;
+    }
+
+    public String getPassphrase()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPassphrase();
+        }
+        return passphrase;
+    }
+
+    public void setPassphrase( String passphrase )
+    {
+        checkAttributesAllowed();
+        this.passphrase = passphrase;
+    }
+
+    public List<String> getServers()
+    {
+        if ( isReference() )
+        {
+            return getRef().getServers();
+        }
+        return servers;
+    }
+
+    public void setServers( String servers )
+    {
+        checkAttributesAllowed();
+        this.servers.clear();
+        String[] split = servers.split( "[;:]" );
+        for ( String server : split )
+        {
+            server = server.trim();
+            if ( server.length() > 0 )
+            {
+                this.servers.add( server );
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependencies.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependencies.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependencies.java
new file mode 100644
index 0000000..5e1ea3c
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependencies.java
@@ -0,0 +1,197 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Dependencies
+    extends DataType
+    implements DependencyContainer
+{
+
+    private File file;
+
+    private Pom pom;
+
+    private List<DependencyContainer> containers = new ArrayList<DependencyContainer>();
+
+    private List<Exclusion> exclusions = new ArrayList<Exclusion>();
+
+    private boolean nestedDependencies;
+
+    protected Dependencies getRef()
+    {
+        return (Dependencies) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            if ( getPom() != null && getPom().getFile() == null )
+            {
+                throw new BuildException( "A <pom> used for dependency resolution has to be backed by a pom.xml file" );
+            }
+            Map<String, String> ids = new HashMap<String, String>();
+            for ( DependencyContainer container : containers )
+            {
+                container.validate( task );
+                if ( container instanceof Dependency )
+                {
+                    Dependency dependency = (Dependency) container;
+                    String id = dependency.getVersionlessKey();
+                    String collision = ids.put( id, dependency.getVersion() );
+                    if ( collision != null )
+                    {
+                        throw new BuildException( "You must not declare multiple <dependency> elements"
+                            + " with the same coordinates but got " + id + " -> " + collision + " vs "
+                            + dependency.getVersion() );
+                    }
+                }
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( pom != null || !exclusions.isEmpty() || !containers.isEmpty() )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public void setFile( File file )
+    {
+        checkAttributesAllowed();
+        this.file = file;
+        checkExternalSources();
+    }
+
+    public File getFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getFile();
+        }
+        return file;
+    }
+
+    public void addPom( Pom pom )
+    {
+        checkChildrenAllowed();
+        if ( this.pom != null )
+        {
+            throw new BuildException( "You must not specify multiple <pom> elements" );
+        }
+        this.pom = pom;
+        checkExternalSources();
+    }
+
+    public Pom getPom()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPom();
+        }
+        return pom;
+    }
+
+    public void setPomRef( Reference ref )
+    {
+        if ( pom == null )
+        {
+            pom = new Pom();
+            pom.setProject( getProject() );
+        }
+        pom.setRefid( ref );
+        checkExternalSources();
+    }
+
+    private void checkExternalSources()
+    {
+        if ( file != null && pom != null )
+        {
+            throw new BuildException( "You must not specify both a text file and a POM to list dependencies" );
+        }
+        if ( ( file != null || pom != null ) && nestedDependencies )
+        {
+            throw new BuildException( "You must not specify both a file/POM and nested dependency collections" );
+        }
+    }
+
+    public void addDependency( Dependency dependency )
+    {
+        checkChildrenAllowed();
+        containers.add( dependency );
+    }
+
+    public void addDependencies( Dependencies dependencies )
+    {
+        checkChildrenAllowed();
+        if ( dependencies == this )
+        {
+            throw circularReference();
+        }
+        containers.add( dependencies );
+        nestedDependencies = true;
+        checkExternalSources();
+    }
+
+    public List<DependencyContainer> getDependencyContainers()
+    {
+        if ( isReference() )
+        {
+            return getRef().getDependencyContainers();
+        }
+        return containers;
+    }
+
+    public void addExclusion( Exclusion exclusion )
+    {
+        checkChildrenAllowed();
+        this.exclusions.add( exclusion );
+    }
+
+    public List<Exclusion> getExclusions()
+    {
+        if ( isReference() )
+        {
+            return getRef().getExclusions();
+        }
+        return exclusions;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependency.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependency.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependency.java
new file mode 100644
index 0000000..9299a5f
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Dependency.java
@@ -0,0 +1,329 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Dependency
+    extends DataType
+    implements DependencyContainer
+{
+
+    private String groupId;
+
+    private String artifactId;
+
+    private String version;
+
+    private String classifier;
+
+    private String type;
+
+    private String scope;
+
+    private File systemPath;
+
+    private List<Exclusion> exclusions = new ArrayList<Exclusion>();
+
+    protected Dependency getRef()
+    {
+        return (Dependency) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            if ( groupId == null || groupId.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'groupId' for a dependency" );
+            }
+            if ( artifactId == null || artifactId.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'artifactId' for a dependency" );
+            }
+            if ( version == null || version.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'version' for a dependency" );
+            }
+
+            if ( "system".equals( scope ) )
+            {
+                if ( systemPath == null )
+                {
+                    throw new BuildException( "You must specify 'systemPath' for dependencies with scope=system" );
+                }
+            }
+            else if ( systemPath != null )
+            {
+                throw new BuildException( "You may only specify 'systemPath' for dependencies with scope=system" );
+            }
+
+            if ( scope != null && !"compile".equals( scope ) && !"provided".equals( scope ) && !"system".equals( scope )
+                && !"runtime".equals( scope ) && !"test".equals( scope ) )
+            {
+                task.log( "Unknown scope '" + scope + "' for dependency", Project.MSG_WARN );
+            }
+
+            for ( Exclusion exclusion : exclusions )
+            {
+                exclusion.validate( task );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( groupId != null || artifactId != null || type != null || classifier != null || version != null
+            || scope != null || systemPath != null )
+        {
+            throw tooManyAttributes();
+        }
+        if ( !exclusions.isEmpty() )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getGroupId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getGroupId();
+        }
+        return groupId;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        checkAttributesAllowed();
+        if ( this.groupId != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getArtifactId();
+        }
+        return artifactId;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        checkAttributesAllowed();
+        if ( this.artifactId != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.artifactId = artifactId;
+    }
+
+    public String getVersion()
+    {
+        if ( isReference() )
+        {
+            return getRef().getVersion();
+        }
+        return version;
+    }
+
+    public void setVersion( String version )
+    {
+        checkAttributesAllowed();
+        if ( this.version != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.version = version;
+    }
+
+    public String getClassifier()
+    {
+        if ( isReference() )
+        {
+            return getRef().getClassifier();
+        }
+        return classifier;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        checkAttributesAllowed();
+        if ( this.classifier != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.classifier = classifier;
+    }
+
+    public String getType()
+    {
+        if ( isReference() )
+        {
+            return getRef().getType();
+        }
+        return ( type != null ) ? type : "jar";
+    }
+
+    public void setType( String type )
+    {
+        checkAttributesAllowed();
+        if ( this.type != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.type = type;
+    }
+
+    public String getScope()
+    {
+        if ( isReference() )
+        {
+            return getRef().getScope();
+        }
+        return ( scope != null ) ? scope : "compile";
+    }
+
+    public void setScope( String scope )
+    {
+        checkAttributesAllowed();
+        if ( this.scope != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.scope = scope;
+    }
+
+    public void setCoords( String coords )
+    {
+        checkAttributesAllowed();
+        if ( groupId != null || artifactId != null || version != null || type != null || classifier != null
+            || scope != null )
+        {
+            throw ambiguousCoords();
+        }
+        Pattern p = Pattern.compile( "([^: ]+):([^: ]+):([^: ]+)((:([^: ]+)(:([^: ]+))?)?:([^: ]+))?" );
+        Matcher m = p.matcher( coords );
+        if ( !m.matches() )
+        {
+            throw new BuildException( "Bad dependency coordinates '" + coords
+                + "', expected format is <groupId>:<artifactId>:<version>[[:<type>[:<classifier>]]:<scope>]" );
+        }
+        groupId = m.group( 1 );
+        artifactId = m.group( 2 );
+        version = m.group( 3 );
+        type = m.group( 6 );
+        if ( type == null || type.length() <= 0 )
+        {
+            type = "jar";
+        }
+        classifier = m.group( 8 );
+        if ( classifier == null )
+        {
+            classifier = "";
+        }
+        scope = m.group( 9 );
+    }
+
+    public void setSystemPath( File systemPath )
+    {
+        checkAttributesAllowed();
+        this.systemPath = systemPath;
+    }
+
+    public File getSystemPath()
+    {
+        if ( isReference() )
+        {
+            return getRef().getSystemPath();
+        }
+        return systemPath;
+    }
+
+    public String getVersionlessKey()
+    {
+        if ( isReference() )
+        {
+            return getRef().getVersionlessKey();
+        }
+        StringBuilder key = new StringBuilder( 128 );
+        if ( groupId != null )
+        {
+            key.append( groupId );
+        }
+        key.append( ':' );
+        if ( artifactId != null )
+        {
+            key.append( artifactId );
+        }
+        key.append( ':' );
+        key.append( ( type != null ) ? type : "jar" );
+        if ( classifier != null && classifier.length() > 0 )
+        {
+            key.append( ':' );
+            key.append( classifier );
+        }
+        return key.toString();
+    }
+
+    public void addExclusion( Exclusion exclusion )
+    {
+        checkChildrenAllowed();
+        this.exclusions.add( exclusion );
+    }
+
+    public List<Exclusion> getExclusions()
+    {
+        if ( isReference() )
+        {
+            return getRef().getExclusions();
+        }
+        return exclusions;
+    }
+
+    private BuildException ambiguousCoords()
+    {
+        return new BuildException( "You must not specify both 'coords' and "
+            + "('groupId', 'artifactId', 'version', 'extension', 'classifier', 'scope')" );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/DependencyContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/DependencyContainer.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/DependencyContainer.java
new file mode 100644
index 0000000..bcca972
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/DependencyContainer.java
@@ -0,0 +1,31 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.tools.ant.Task;
+
+/**
+ */
+public interface DependencyContainer
+{
+
+    void validate( Task task );
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Exclusion.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Exclusion.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Exclusion.java
new file mode 100644
index 0000000..ea0e06e
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Exclusion.java
@@ -0,0 +1,190 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Exclusion
+    extends DataType
+{
+
+    private static final String WILDCARD = "*";
+
+    private String groupId;
+
+    private String artifactId;
+
+    private String classifier;
+
+    private String extension;
+
+    protected Exclusion getRef()
+    {
+        return (Exclusion) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            if ( groupId == null && artifactId == null && classifier == null && extension == null )
+            {
+                throw new BuildException( "You must specify at least one of "
+                    + "'groupId', 'artifactId', 'classifier' or 'extension'" );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( groupId != null || artifactId != null || extension != null || classifier != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getGroupId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getGroupId();
+        }
+        return ( groupId != null ) ? groupId : WILDCARD;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        checkAttributesAllowed();
+        if ( this.groupId != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getArtifactId();
+        }
+        return ( artifactId != null ) ? artifactId : WILDCARD;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        checkAttributesAllowed();
+        if ( this.artifactId != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.artifactId = artifactId;
+    }
+
+    public String getClassifier()
+    {
+        if ( isReference() )
+        {
+            return getRef().getClassifier();
+        }
+        return ( classifier != null ) ? classifier : WILDCARD;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        checkAttributesAllowed();
+        if ( this.classifier != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.classifier = classifier;
+    }
+
+    public String getExtension()
+    {
+        if ( isReference() )
+        {
+            return getRef().getExtension();
+        }
+        return ( extension != null ) ? extension : WILDCARD;
+    }
+
+    public void setExtension( String extension )
+    {
+        checkAttributesAllowed();
+        if ( this.extension != null )
+        {
+            throw ambiguousCoords();
+        }
+        this.extension = extension;
+    }
+
+    public void setCoords( String coords )
+    {
+        checkAttributesAllowed();
+        if ( groupId != null || artifactId != null || extension != null || classifier != null )
+        {
+            throw ambiguousCoords();
+        }
+        Pattern p = Pattern.compile( "([^: ]+)(:([^: ]+)(:([^: ]+)(:([^: ]*))?)?)?" );
+        Matcher m = p.matcher( coords );
+        if ( !m.matches() )
+        {
+            throw new BuildException( "Bad exclusion coordinates '" + coords
+                + "', expected format is <groupId>[:<artifactId>[:<extension>[:<classifier>]]]" );
+        }
+        groupId = m.group( 1 );
+        artifactId = m.group( 3 );
+        if ( artifactId == null )
+        {
+            artifactId = "*";
+        }
+        extension = m.group( 5 );
+        if ( extension == null )
+        {
+            extension = "*";
+        }
+        classifier = m.group( 7 );
+        if ( classifier == null )
+        {
+            classifier = "*";
+        }
+    }
+
+    private BuildException ambiguousCoords()
+    {
+        return new BuildException( "You must not specify both 'coords' and "
+            + "('groupId', 'artifactId', 'extension', 'classifier')" );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/LocalRepository.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/LocalRepository.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/LocalRepository.java
new file mode 100644
index 0000000..8847e54
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/LocalRepository.java
@@ -0,0 +1,90 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class LocalRepository
+    extends DataType
+{
+
+    private final Task task;
+
+    private File dir;
+
+    public LocalRepository()
+    {
+        this( null );
+    }
+
+    public LocalRepository( Task task )
+    {
+        this.task = task;
+    }
+
+    @Override
+    public void setProject( Project project )
+    {
+        super.setProject( project );
+
+        if ( task == null )
+        {
+            AntRepoSys.getInstance( project ).setLocalRepository( this );
+        }
+    }
+
+    protected LocalRepository getRef()
+    {
+        return (LocalRepository) getCheckedRef();
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( dir != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public File getDir()
+    {
+        if ( isReference() )
+        {
+            return getRef().getDir();
+        }
+        return dir;
+    }
+
+    public void setDir( File dir )
+    {
+        checkAttributesAllowed();
+        this.dir = dir;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Mirror.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Mirror.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Mirror.java
new file mode 100644
index 0000000..21534e8
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Mirror.java
@@ -0,0 +1,154 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Mirror
+    extends DataType
+{
+
+    private String id;
+
+    private String url;
+
+    private String type;
+
+    private String mirrorOf;
+
+    private Authentication authentication;
+
+    @Override
+    public void setProject( Project project )
+    {
+        super.setProject( project );
+
+        AntRepoSys.getInstance( project ).addMirror( this );
+    }
+
+    protected Mirror getRef()
+    {
+        return (Mirror) getCheckedRef();
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( id != null || url != null || mirrorOf != null || type != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getId();
+        }
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public String getUrl()
+    {
+        if ( isReference() )
+        {
+            return getRef().getUrl();
+        }
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        checkAttributesAllowed();
+        this.url = url;
+    }
+
+    public String getType()
+    {
+        if ( isReference() )
+        {
+            return getRef().getType();
+        }
+        return ( type != null ) ? type : "default";
+    }
+
+    public void setType( String type )
+    {
+        checkAttributesAllowed();
+        this.type = type;
+    }
+
+    public String getMirrorOf()
+    {
+        if ( isReference() )
+        {
+            return getRef().getMirrorOf();
+        }
+        return mirrorOf;
+    }
+
+    public void setMirrorOf( String mirrorOf )
+    {
+        checkAttributesAllowed();
+        this.mirrorOf = mirrorOf;
+    }
+
+    public void addAuthentication( Authentication authentication )
+    {
+        checkChildrenAllowed();
+        if ( this.authentication != null )
+        {
+            throw new BuildException( "You must not specify multiple <authentication> elements" );
+        }
+        this.authentication = authentication;
+    }
+
+    public Authentication getAuthentication()
+    {
+        if ( isReference() )
+        {
+            getRef().getAuthentication();
+        }
+        return authentication;
+    }
+
+    public void setAuthRef( Reference ref )
+    {
+        if ( authentication == null )
+        {
+            authentication = new Authentication();
+            authentication.setProject( getProject() );
+        }
+        authentication.setRefid( ref );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/ModelValueExtractor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/ModelValueExtractor.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/ModelValueExtractor.java
new file mode 100644
index 0000000..c1ab45c
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/ModelValueExtractor.java
@@ -0,0 +1,99 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.maven.model.Model;
+import org.apache.tools.ant.Project;
+import org.codehaus.plexus.interpolation.reflection.ReflectionValueExtractor;
+
+/**
+ */
+class ModelValueExtractor
+{
+
+    private static final String PREFIX_PROPERTIES = "properties.";
+
+    private final String prefix;
+
+    private final Project project;
+
+    private final Model model;
+
+    public ModelValueExtractor( String prefix, Model model, Project project )
+    {
+        if ( model == null )
+        {
+            throw new IllegalArgumentException( "reference to Maven POM has not been specified" );
+        }
+        if ( project == null )
+        {
+            throw new IllegalArgumentException( "reference to Ant project has not been specified" );
+        }
+        if ( prefix == null || prefix.length() <= 0 )
+        {
+            prefix = "pom.";
+        }
+        else if ( !prefix.endsWith( "." ) )
+        {
+            prefix += '.';
+        }
+        this.prefix = prefix;
+        this.model = model;
+        this.project = project;
+    }
+
+    public Project getProject()
+    {
+        return project;
+    }
+
+    public boolean isApplicable( String expression )
+    {
+        return expression.startsWith( prefix );
+    }
+
+    public Object getValue( String expression )
+    {
+        if ( expression.startsWith( prefix ) )
+        {
+            String expr = expression.substring( prefix.length() );
+            try
+            {
+                if ( expr.startsWith( PREFIX_PROPERTIES ) )
+                {
+                    String key = expr.substring( PREFIX_PROPERTIES.length() );
+                    return model.getProperties().getProperty( key );
+                }
+
+                return ReflectionValueExtractor.evaluate( expr, model, false );
+            }
+            catch ( Exception e )
+            {
+                project.log( "Could not retrieve '" + expression + "' from POM: " + e.getMessage(), e, Project.MSG_WARN );
+                return null;
+            }
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Pom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Pom.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Pom.java
new file mode 100644
index 0000000..62ca308
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Pom.java
@@ -0,0 +1,352 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.maven.resolver.internal.ant.ProjectWorkspaceReader;
+import org.apache.maven.resolver.internal.ant.tasks.RefTask;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.PropertyHelper;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Pom
+    extends RefTask
+{
+
+    private Model model;
+
+    private String id;
+
+    private File file;
+
+    private String groupId;
+
+    private String artifactId;
+
+    private String version;
+
+    private String packaging = "jar";
+
+    private RemoteRepositories remoteRepositories;
+
+    private String coords;
+
+    protected Pom getRef()
+    {
+        return (Pom) getCheckedRef();
+    }
+
+    public void validate()
+    {
+        if ( isReference() )
+        {
+            getRef().validate();
+        }
+        else
+        {
+            if ( file == null )
+            {
+                if ( groupId == null )
+                {
+                    throw new BuildException( "You must specify the 'groupId' for the POM" );
+                }
+                if ( artifactId == null )
+                {
+                    throw new BuildException( "You must specify the 'artifactId' for the POM" );
+                }
+                if ( version == null )
+                {
+                    throw new BuildException( "You must specify the 'version' for the POM" );
+                }
+            }
+        }
+
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( id != null || file != null || groupId != null || artifactId != null || version != null )
+        {
+            throw tooManyAttributes();
+        }
+        if ( remoteRepositories != null )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public void setId( String id )
+    {
+        checkAttributesAllowed();
+        this.id = id;
+    }
+
+    public File getFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getFile();
+        }
+        return file;
+    }
+
+    public void setFile( File file )
+    {
+        checkAttributesAllowed();
+        if ( groupId != null || artifactId != null || version != null )
+        {
+            throw ambiguousSource();
+        }
+
+        this.file = file;
+
+    }
+
+    public String getGroupId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getGroupId();
+        }
+        return groupId;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        checkAttributesAllowed();
+        if ( this.groupId != null )
+        {
+            throw ambiguousCoords();
+        }
+        if ( file != null )
+        {
+            throw ambiguousSource();
+        }
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getArtifactId();
+        }
+        return artifactId;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        checkAttributesAllowed();
+        if ( this.artifactId != null )
+        {
+            throw ambiguousCoords();
+        }
+        if ( file != null )
+        {
+            throw ambiguousSource();
+        }
+        this.artifactId = artifactId;
+    }
+
+    public String getVersion()
+    {
+        if ( isReference() )
+        {
+            return getRef().getVersion();
+        }
+        return version;
+    }
+
+    public void setVersion( String version )
+    {
+        checkAttributesAllowed();
+        if ( this.version != null )
+        {
+            throw ambiguousCoords();
+        }
+        if ( file != null )
+        {
+            throw ambiguousSource();
+        }
+        this.version = version;
+    }
+
+    public String getCoords()
+    {
+        if ( isReference() )
+        {
+            return getRef().getCoords();
+        }
+        return coords;
+    }
+
+    public void setCoords( String coords )
+    {
+        checkAttributesAllowed();
+        if ( file != null )
+        {
+            throw ambiguousSource();
+        }
+        if ( groupId != null || artifactId != null || version != null )
+        {
+            throw ambiguousCoords();
+        }
+        Pattern p = Pattern.compile( "([^: ]+):([^: ]+):([^: ]+)" );
+        Matcher m = p.matcher( coords );
+        if ( !m.matches() )
+        {
+            throw new BuildException( "Bad POM coordinates, expected format is <groupId>:<artifactId>:<version>" );
+        }
+        groupId = m.group( 1 );
+        artifactId = m.group( 2 );
+        version = m.group( 3 );
+    }
+
+    private BuildException ambiguousCoords()
+    {
+        return new BuildException( "You must not specify both 'coords' and ('groupId', 'artifactId', 'version')" );
+    }
+
+    private BuildException ambiguousSource()
+    {
+        return new BuildException( "You must not specify both 'file' and "
+            + "('coords', 'groupId', 'artifactId', 'version')" );
+    }
+
+    public String getPackaging()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPackaging();
+        }
+        return packaging;
+    }
+
+    public void setPackaging( String packaging )
+    {
+        checkAttributesAllowed();
+        if ( file != null )
+        {
+            throw ambiguousSource();
+        }
+        this.packaging = packaging;
+    }
+
+    private RemoteRepositories getRemoteRepos()
+    {
+        if ( remoteRepositories == null )
+        {
+            remoteRepositories = new RemoteRepositories();
+            remoteRepositories.setProject( getProject() );
+        }
+        return remoteRepositories;
+    }
+
+    public void addRemoteRepo( RemoteRepository repository )
+    {
+        getRemoteRepos().addRemoterepo( repository );
+    }
+
+    public void addRemoteRepos( RemoteRepositories repositories )
+    {
+        getRemoteRepos().addRemoterepos( repositories );
+    }
+
+    public void setRemoteReposRef( Reference ref )
+    {
+        RemoteRepositories repos = new RemoteRepositories();
+        repos.setProject( getProject() );
+        repos.setRefid( ref );
+        getRemoteRepos().addRemoterepos( repos );
+    }
+
+    public Model getModel( Task task )
+    {
+        if ( isReference() )
+        {
+            return getRef().getModel( task );
+        }
+        synchronized ( this )
+        {
+            if ( model == null )
+            {
+                if ( file != null )
+                {
+                    model = AntRepoSys.getInstance( getProject() ).loadModel( task, file, true, remoteRepositories );
+                }
+            }
+            return model;
+        }
+    }
+
+    @Override
+    public void execute()
+    {
+        validate();
+
+        if ( file != null && ( id == null || AntRepoSys.getInstance( getProject() ).getDefaultPom() == null ) )
+        {
+            AntRepoSys.getInstance( getProject() ).setDefaultPom( this );
+        }
+
+        ProjectWorkspaceReader.getInstance().addPom( this );
+
+        Model model = getModel( this );
+
+        if ( model == null )
+        {
+            coords = getGroupId() + ":" + getArtifactId() + ":" + getVersion();
+            return;
+        }
+
+        coords = model.getGroupId() + ":" + model.getArtifactId() + ":" + model.getVersion();
+
+        ModelValueExtractor extractor = new ModelValueExtractor( id, model, getProject() );
+
+        PropertyHelper propHelper = PropertyHelper.getPropertyHelper( getProject() );
+
+        try
+        {
+            // Ant 1.8.0 delegate
+            PomPropertyEvaluator.register( extractor, propHelper );
+        }
+        catch ( LinkageError e )
+        {
+            // Ant 1.6 - 1.7.1 interceptor chaining
+            PomPropertyHelper.register( extractor, propHelper );
+        }
+
+    }
+
+    public String toString()
+    {
+        return coords + " (" + super.toString() + ")";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyEvaluator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyEvaluator.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyEvaluator.java
new file mode 100644
index 0000000..1b76bfd
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyEvaluator.java
@@ -0,0 +1,62 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.tools.ant.PropertyHelper;
+import org.apache.tools.ant.PropertyHelper.PropertyEvaluator;
+import org.apache.tools.ant.property.NullReturn;
+
+/**
+ */
+class PomPropertyEvaluator
+    implements PropertyEvaluator
+{
+
+    private final ModelValueExtractor extractor;
+
+    public static void register( ModelValueExtractor extractor, PropertyHelper propertyHelper )
+    {
+        propertyHelper.add( new PomPropertyEvaluator( extractor ) );
+    }
+
+    private PomPropertyEvaluator( ModelValueExtractor extractor )
+    {
+        if ( extractor == null )
+        {
+            throw new IllegalArgumentException( "no model value exractor specified" );
+        }
+        this.extractor = extractor;
+    }
+
+    public Object evaluate( String property, PropertyHelper propertyHelper )
+    {
+        Object value = extractor.getValue( property );
+        if ( value != null )
+        {
+            return value;
+        }
+        else if ( extractor.isApplicable( property ) )
+        {
+            return NullReturn.NULL;
+        }
+        return null;
+    }
+
+}


[2/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyHelper.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyHelper.java
new file mode 100644
index 0000000..5ec23ec
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/PomPropertyHelper.java
@@ -0,0 +1,65 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.tools.ant.PropertyHelper;
+
+/**
+ */
+@SuppressWarnings( "deprecation" )
+class PomPropertyHelper
+    extends PropertyHelper
+{
+
+    private final ModelValueExtractor extractor;
+
+    public static void register( ModelValueExtractor extractor, PropertyHelper propertyHelper )
+    {
+        PomPropertyHelper helper = new PomPropertyHelper( extractor );
+        helper.setNext( propertyHelper.getNext() );
+        propertyHelper.setNext( helper );
+    }
+
+    public PomPropertyHelper( ModelValueExtractor extractor )
+    {
+        if ( extractor == null )
+        {
+            throw new IllegalArgumentException( "no model value exractor specified" );
+        }
+        this.extractor = extractor;
+        setProject( extractor.getProject() );
+    }
+
+    @Override
+    public Object getPropertyHook( String ns, String name, boolean user )
+    {
+        Object value = extractor.getValue( name );
+        if ( value != null )
+        {
+            return value;
+        }
+        else if ( extractor.isApplicable( name ) )
+        {
+            return null;
+        }
+        return super.getPropertyHook( ns, name, user );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Proxy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Proxy.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Proxy.java
new file mode 100644
index 0000000..6116c8e
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Proxy.java
@@ -0,0 +1,163 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Proxy
+    extends DataType
+{
+
+    private String host;
+
+    private int port;
+
+    private String type;
+
+    private String nonProxyHosts;
+
+    private Authentication authentication;
+
+    @Override
+    public void setProject( Project project )
+    {
+        super.setProject( project );
+
+        AntRepoSys.getInstance( project ).addProxy( this );
+    }
+
+    protected Proxy getRef()
+    {
+        return (Proxy) getCheckedRef();
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( host != null || port != 0 || type != null || nonProxyHosts != null )
+        {
+            throw tooManyAttributes();
+        }
+        if ( authentication != null )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getHost()
+    {
+        if ( isReference() )
+        {
+            return getRef().getHost();
+        }
+        return host;
+    }
+
+    public void setHost( String host )
+    {
+        checkAttributesAllowed();
+        this.host = host;
+    }
+
+    public int getPort()
+    {
+        if ( isReference() )
+        {
+            return getRef().getPort();
+        }
+        return port;
+    }
+
+    public void setPort( int port )
+    {
+        checkAttributesAllowed();
+        if ( port <= 0 || port > 0xFFFF )
+        {
+            throw new BuildException( "The port number must be within the range 1 - 65535" );
+        }
+        this.port = port;
+    }
+
+    public String getType()
+    {
+        if ( isReference() )
+        {
+            return getRef().getType();
+        }
+        return type;
+    }
+
+    public void setType( String type )
+    {
+        checkAttributesAllowed();
+        this.type = type;
+    }
+
+    public String getNonProxyHosts()
+    {
+        if ( isReference() )
+        {
+            return getRef().getNonProxyHosts();
+        }
+        return nonProxyHosts;
+    }
+
+    public void setNonProxyHosts( String nonProxyHosts )
+    {
+        checkAttributesAllowed();
+        this.nonProxyHosts = nonProxyHosts;
+    }
+
+    public Authentication getAuthentication()
+    {
+        if ( isReference() )
+        {
+            return getRef().getAuthentication();
+        }
+        return authentication;
+    }
+
+    public void addAuthentication( Authentication authentication )
+    {
+        checkChildrenAllowed();
+        if ( this.authentication != null )
+        {
+            throw new BuildException( "You must not specify multiple <authentication> elements" );
+        }
+        this.authentication = authentication;
+    }
+
+    public void setAuthRef( Reference ref )
+    {
+        if ( authentication == null )
+        {
+            authentication = new Authentication();
+            authentication.setProject( getProject() );
+        }
+        authentication.setRefid( ref );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositories.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositories.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositories.java
new file mode 100644
index 0000000..0b90877
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositories.java
@@ -0,0 +1,97 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class RemoteRepositories
+    extends DataType
+    implements RemoteRepositoryContainer
+{
+
+    private List<RemoteRepositoryContainer> containers = new ArrayList<RemoteRepositoryContainer>();
+
+    protected RemoteRepositories getRef()
+    {
+        return (RemoteRepositories) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            for ( RemoteRepositoryContainer container : containers )
+            {
+                container.validate( task );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( !containers.isEmpty() )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public void addRemoterepo( RemoteRepository repository )
+    {
+        checkChildrenAllowed();
+        containers.add( repository );
+    }
+
+    public void addRemoterepos( RemoteRepositories repositories )
+    {
+        checkChildrenAllowed();
+        if ( repositories == this )
+        {
+            throw circularReference();
+        }
+        containers.add( repositories );
+    }
+
+    public List<RemoteRepository> getRepositories()
+    {
+        if ( isReference() )
+        {
+            return getRef().getRepositories();
+        }
+        List<RemoteRepository> repos = new ArrayList<RemoteRepository>();
+        for ( RemoteRepositoryContainer container : containers )
+        {
+            repos.addAll( container.getRepositories() );
+        }
+        return repos;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepository.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepository.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepository.java
new file mode 100644
index 0000000..aabefd2
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepository.java
@@ -0,0 +1,351 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+import org.eclipse.aether.repository.RepositoryPolicy;
+
+/**
+ */
+public class RemoteRepository
+    extends DataType
+    implements RemoteRepositoryContainer
+{
+
+    private String id;
+
+    private String url;
+
+    private String type;
+
+    private Policy releasePolicy;
+
+    private Policy snapshotPolicy;
+
+    private boolean releases = true;
+
+    private boolean snapshots = false;
+
+    private String checksums;
+
+    private String updates;
+
+    private Authentication authentication;
+
+    @Override
+    public void setProject( Project project )
+    {
+        super.setProject( project );
+
+        // NOTE: Just trigger side-effect of default initialization before this type potentially overrides central
+        AntRepoSys.getInstance( project );
+    }
+
+    protected RemoteRepository getRef()
+    {
+        return (RemoteRepository) getCheckedRef();
+    }
+
+    public void validate( Task task )
+    {
+        if ( isReference() )
+        {
+            getRef().validate( task );
+        }
+        else
+        {
+            if ( url == null || url.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'url' for a remote repository" );
+            }
+            if ( id == null || id.length() <= 0 )
+            {
+                throw new BuildException( "You must specify the 'id' for a remote repository" );
+            }
+        }
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( id != null || url != null || type != null || checksums != null || updates != null )
+        {
+            throw tooManyAttributes();
+        }
+        if ( releasePolicy != null || snapshotPolicy != null || authentication != null )
+        {
+            throw noChildrenAllowed();
+        }
+        super.setRefid( ref );
+    }
+
+    public String getId()
+    {
+        if ( isReference() )
+        {
+            return getRef().getId();
+        }
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public String getUrl()
+    {
+        if ( isReference() )
+        {
+            return getRef().getUrl();
+        }
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        checkAttributesAllowed();
+        this.url = url;
+    }
+
+    public String getType()
+    {
+        if ( isReference() )
+        {
+            return getRef().getType();
+        }
+        return ( type != null ) ? type : "default";
+    }
+
+    public void setType( String type )
+    {
+        checkAttributesAllowed();
+        this.type = type;
+    }
+
+    public Policy getReleasePolicy()
+    {
+        if ( isReference() )
+        {
+            return getRef().getReleasePolicy();
+        }
+        return releasePolicy;
+    }
+
+    public void addReleases( Policy policy )
+    {
+        checkChildrenAllowed();
+        if ( this.releasePolicy != null )
+        {
+            throw new BuildException( "You must not specify multiple <releases> elements" );
+        }
+        this.releasePolicy = policy;
+    }
+
+    public Policy getSnapshotPolicy()
+    {
+        if ( isReference() )
+        {
+            return getRef().getSnapshotPolicy();
+        }
+        return snapshotPolicy;
+    }
+
+    public void addSnapshots( Policy policy )
+    {
+        checkChildrenAllowed();
+        if ( this.snapshotPolicy != null )
+        {
+            throw new BuildException( "You must not specify multiple <snapshots> elements" );
+        }
+        this.snapshotPolicy = policy;
+    }
+
+    public boolean isReleases()
+    {
+        if ( isReference() )
+        {
+            return getRef().isReleases();
+        }
+        return releases;
+    }
+
+    public void setReleases( boolean releases )
+    {
+        checkAttributesAllowed();
+        this.releases = releases;
+    }
+
+    public boolean isSnapshots()
+    {
+        if ( isReference() )
+        {
+            return getRef().isSnapshots();
+        }
+        return snapshots;
+    }
+
+    public void setSnapshots( boolean snapshots )
+    {
+        checkAttributesAllowed();
+        this.snapshots = snapshots;
+    }
+
+    public String getUpdates()
+    {
+        if ( isReference() )
+        {
+            return getRef().getUpdates();
+        }
+        return ( updates != null ) ? updates : RepositoryPolicy.UPDATE_POLICY_DAILY;
+    }
+
+    public void setUpdates( String updates )
+    {
+        checkAttributesAllowed();
+        checkUpdates( updates );
+        this.updates = updates;
+    }
+
+    protected static void checkUpdates( String updates )
+    {
+        if ( !RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( updates )
+            && !RepositoryPolicy.UPDATE_POLICY_DAILY.equals( updates )
+            && !RepositoryPolicy.UPDATE_POLICY_NEVER.equals( updates )
+            && !updates.startsWith( RepositoryPolicy.UPDATE_POLICY_INTERVAL ) )
+        {
+            throw new BuildException( "'" + updates + "' is not a permitted update policy" );
+        }
+    }
+
+    public String getChecksums()
+    {
+        if ( isReference() )
+        {
+            return getRef().getChecksums();
+        }
+        return ( checksums != null ) ? checksums : RepositoryPolicy.CHECKSUM_POLICY_WARN;
+    }
+
+    public void setChecksums( String checksums )
+    {
+        checkAttributesAllowed();
+        checkChecksums( checksums );
+        this.checksums = checksums;
+    }
+
+    protected static void checkChecksums( String checksums )
+    {
+        if ( !RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( checksums )
+            && !RepositoryPolicy.CHECKSUM_POLICY_WARN.equals( checksums )
+            && !RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( checksums ) )
+        {
+            throw new BuildException( "'" + checksums + "' is not a permitted checksum policy" );
+        }
+    }
+
+    public Authentication getAuthentication()
+    {
+        if ( isReference() )
+        {
+            return getRef().getAuthentication();
+        }
+        return authentication;
+    }
+
+    public void addAuthentication( Authentication authentication )
+    {
+        checkChildrenAllowed();
+        if ( this.authentication != null )
+        {
+            throw new BuildException( "You must not specify multiple <authentication> elements" );
+        }
+        this.authentication = authentication;
+    }
+
+    public void setAuthRef( Reference ref )
+    {
+        checkAttributesAllowed();
+        if ( authentication == null )
+        {
+            authentication = new Authentication();
+            authentication.setProject( getProject() );
+        }
+        authentication.setRefid( ref );
+    }
+
+    public List<RemoteRepository> getRepositories()
+    {
+        return Collections.singletonList( this );
+    }
+
+    /**
+     */
+    public static class Policy
+    {
+
+        private boolean enabled = true;
+
+        private String checksumPolicy;
+
+        private String updatePolicy;
+
+        public boolean isEnabled()
+        {
+            return enabled;
+        }
+
+        public void setEnabled( boolean enabled )
+        {
+            this.enabled = enabled;
+        }
+
+        public String getChecksums()
+        {
+            return checksumPolicy;
+        }
+
+        public void setChecksums( String checksumPolicy )
+        {
+            checkChecksums( checksumPolicy );
+            this.checksumPolicy = checksumPolicy;
+        }
+
+        public String getUpdates()
+        {
+            return updatePolicy;
+        }
+
+        public void setUpdates( String updatePolicy )
+        {
+            checkUpdates( updatePolicy );
+            this.updatePolicy = updatePolicy;
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositoryContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositoryContainer.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositoryContainer.java
new file mode 100644
index 0000000..ab84a98
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/RemoteRepositoryContainer.java
@@ -0,0 +1,35 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.tools.ant.Task;
+
+/**
+ */
+public interface RemoteRepositoryContainer
+{
+
+    void validate( Task task );
+
+    List<RemoteRepository> getRepositories();
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/types/Settings.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/types/Settings.java b/src/main/java/org/apache/maven/resolver/internal/ant/types/Settings.java
new file mode 100644
index 0000000..5c77c43
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/types/Settings.java
@@ -0,0 +1,86 @@
+package org.apache.maven.resolver.internal.ant.types;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Settings
+    extends DataType
+{
+
+    private File file;
+
+    private File globalFile;
+
+    protected Settings getRef()
+    {
+        return (Settings) getCheckedRef();
+    }
+
+    public void setRefid( Reference ref )
+    {
+        if ( file != null || globalFile != null )
+        {
+            throw tooManyAttributes();
+        }
+        super.setRefid( ref );
+    }
+
+    public File getFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getFile();
+        }
+        return file;
+    }
+
+    public void setFile( File file )
+    {
+        checkAttributesAllowed();
+        this.file = file;
+
+        AntRepoSys.getInstance( getProject() ).setUserSettings( file );
+    }
+
+    public File getGlobalFile()
+    {
+        if ( isReference() )
+        {
+            return getRef().getFile();
+        }
+        return globalFile;
+    }
+
+    public void setGlobalFile( File globalFile )
+    {
+        checkAttributesAllowed();
+        this.globalFile = globalFile;
+
+        AntRepoSys.getInstance( getProject() ).setGlobalSettings( globalFile );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/resources/org/apache/maven/aether/ant/antlib.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/maven/aether/ant/antlib.xml b/src/main/resources/org/apache/maven/aether/ant/antlib.xml
deleted file mode 100644
index d08a0c8..0000000
--- a/src/main/resources/org/apache/maven/aether/ant/antlib.xml
+++ /dev/null
@@ -1,41 +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.
--->
-
-<antlib>
-
-  <typedef name="authentication"       classname="org.apache.maven.aether.internal.ant.types.Authentication"/>
-  <typedef name="proxy"                classname="org.apache.maven.aether.internal.ant.types.Proxy"/>
-  <typedef name="mirror"               classname="org.apache.maven.aether.internal.ant.types.Mirror"/>
-  <typedef name="localrepo"            classname="org.apache.maven.aether.internal.ant.types.LocalRepository"/>
-  <typedef name="remoterepo"           classname="org.apache.maven.aether.internal.ant.types.RemoteRepository"/>
-  <typedef name="remoterepos"          classname="org.apache.maven.aether.internal.ant.types.RemoteRepositories"/>
-  <typedef name="dependency"           classname="org.apache.maven.aether.internal.ant.types.Dependency"/>
-  <typedef name="dependencies"         classname="org.apache.maven.aether.internal.ant.types.Dependencies"/>
-  <typedef name="artifact"             classname="org.apache.maven.aether.internal.ant.types.Artifact"/>
-  <typedef name="artifacts"            classname="org.apache.maven.aether.internal.ant.types.Artifacts"/>
-  <typedef name="settings"             classname="org.apache.maven.aether.internal.ant.types.Settings"/>
-
-  <taskdef name="resolve"              classname="org.apache.maven.aether.internal.ant.tasks.Resolve"/>
-  <taskdef name="install"              classname="org.apache.maven.aether.internal.ant.tasks.Install"/>
-  <taskdef name="deploy"               classname="org.apache.maven.aether.internal.ant.tasks.Deploy"/>
-  <taskdef name="pom"                  classname="org.apache.maven.aether.internal.ant.types.Pom"/>
-
-</antlib>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/resources/org/apache/maven/resolver/ant/antlib.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/maven/resolver/ant/antlib.xml b/src/main/resources/org/apache/maven/resolver/ant/antlib.xml
new file mode 100644
index 0000000..0e47b30
--- /dev/null
+++ b/src/main/resources/org/apache/maven/resolver/ant/antlib.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<antlib>
+
+  <typedef name="authentication"       classname="org.apache.maven.resolver.internal.ant.types.Authentication"/>
+  <typedef name="proxy"                classname="org.apache.maven.resolver.internal.ant.types.Proxy"/>
+  <typedef name="mirror"               classname="org.apache.maven.resolver.internal.ant.types.Mirror"/>
+  <typedef name="localrepo"            classname="org.apache.maven.resolver.internal.ant.types.LocalRepository"/>
+  <typedef name="remoterepo"           classname="org.apache.maven.resolver.internal.ant.types.RemoteRepository"/>
+  <typedef name="remoterepos"          classname="org.apache.maven.resolver.internal.ant.types.RemoteRepositories"/>
+  <typedef name="dependency"           classname="org.apache.maven.resolver.internal.ant.types.Dependency"/>
+  <typedef name="dependencies"         classname="org.apache.maven.resolver.internal.ant.types.Dependencies"/>
+  <typedef name="artifact"             classname="org.apache.maven.resolver.internal.ant.types.Artifact"/>
+  <typedef name="artifacts"            classname="org.apache.maven.resolver.internal.ant.types.Artifacts"/>
+  <typedef name="settings"             classname="org.apache.maven.resolver.internal.ant.types.Settings"/>
+
+  <taskdef name="resolve"              classname="org.apache.maven.resolver.internal.ant.tasks.Resolve"/>
+  <taskdef name="install"              classname="org.apache.maven.resolver.internal.ant.tasks.Install"/>
+  <taskdef name="deploy"               classname="org.apache.maven.resolver.internal.ant.tasks.Deploy"/>
+  <taskdef name="pom"                  classname="org.apache.maven.resolver.internal.ant.types.Pom"/>
+
+</antlib>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/AntBuildsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/AntBuildsTest.java b/src/test/java/org/apache/maven/aether/internal/ant/AntBuildsTest.java
deleted file mode 100644
index 14a6b04..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/AntBuildsTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.File;
-import java.io.PrintStream;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.BuildFileTest;
-import org.apache.tools.ant.DefaultLogger;
-import org.apache.tools.ant.Project;
-import org.eclipse.aether.internal.test.util.TestFileUtils;
-
-public abstract class AntBuildsTest
-    extends BuildFileTest
-{
-
-    private static final File BASE_DIR;
-
-    protected static final File BUILD_DIR;
-
-    static
-    {
-        BASE_DIR = new File( "" ).getAbsoluteFile();
-        BUILD_DIR = new File( BASE_DIR, "target/ant" );
-    }
-
-    protected File projectDir;
-
-    protected File localRepoDir;
-
-    protected File distRepoDir;
-
-    protected String getProjectDirName()
-    {
-        String name = getClass().getSimpleName();
-        if ( name.endsWith( "Test" ) )
-        {
-            name = name.substring( 0, name.length() - 4 );
-        }
-        return name;
-    }
-
-    protected void setUpProperties()
-        throws Exception
-    {
-        // hook for subclasses to set further system properties for the project to pick up
-    }
-
-    @Override
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-
-        TestFileUtils.deleteFile( BUILD_DIR );
-
-        projectDir = new File( new File( BASE_DIR, "src/test/resources/ant" ), getProjectDirName() );
-        localRepoDir = new File( BUILD_DIR, "local-repo" );
-        distRepoDir = new File( BUILD_DIR, "dist-repo" );
-
-        System.setProperty( "project.dir", projectDir.getAbsolutePath() );
-        System.setProperty( "build.dir", BUILD_DIR.getAbsolutePath() );
-        System.setProperty( "maven.repo.local", localRepoDir.getAbsolutePath() );
-        System.setProperty( "project.distrepo.url", distRepoDir.toURI().toString() );
-        setUpProperties();
-
-        configureProject( new File( projectDir, "ant.xml" ).getAbsolutePath(), Project.MSG_VERBOSE );
-    }
-
-    @Override
-    protected void tearDown()
-        throws Exception
-    {
-        try
-        {
-            ProjectWorkspaceReader.dropInstance();
-            TestFileUtils.deleteFile( BUILD_DIR );
-        }
-        finally
-        {
-            super.tearDown();
-        }
-    }
-
-    @Override
-    public void configureProject( String filename, int logLevel )
-        throws BuildException
-    {
-        super.configureProject( filename, logLevel );
-        DefaultLogger logger = new DefaultLogger()
-        {
-            @Override
-            protected void printMessage( String message, PrintStream stream, int priority )
-            {
-                message = System.currentTimeMillis() + " " + message;
-                super.printMessage( message, stream, priority );
-            }
-        };
-        logger.setMessageOutputLevel( logLevel );
-        logger.setOutputPrintStream( System.out );
-        logger.setErrorPrintStream( System.err );
-        getProject().addBuildListener( logger );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/DeployTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/DeployTest.java b/src/test/java/org/apache/maven/aether/internal/ant/DeployTest.java
deleted file mode 100644
index 7b52562..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/DeployTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 static org.hamcrest.MatcherAssert.*;
-import static org.hamcrest.Matchers.*;
-
-import java.io.File;
-import java.util.Arrays;
-
-/*
- * still missing:
- * - deploy snapshots/releases into correct repos
- */
-public class DeployTest
-    extends AntBuildsTest
-{
-
-    public void testDeployGlobalPom()
-    {
-        long min = System.currentTimeMillis();
-        executeTarget( "testDeployGlobalPom" );
-        long max = System.currentTimeMillis();
-
-        assertLogContaining( "Uploading" );
-        
-        assertUpdatedFile( min, max, distRepoDir, "test/dummy/0.1-SNAPSHOT/maven-metadata.xml" );
-    }
-
-    public void testDeployOverrideGlobalPom()
-    {
-        long min = System.currentTimeMillis();
-        executeTarget( "testDeployOverrideGlobalPom" );
-        long max = System.currentTimeMillis();
-
-        assertLogContaining( "Uploading" );
-
-        assertUpdatedFile( min, max, distRepoDir, "test/other/0.1-SNAPSHOT/maven-metadata.xml" );
-    }
-
-    public void testDeployOverrideGlobalPomByRef()
-    {
-        long min = System.currentTimeMillis();
-        executeTarget( "testDeployOverrideGlobalPomByRef" );
-        long max = System.currentTimeMillis();
-
-        assertLogContaining( "Uploading" );
-
-        assertUpdatedFile( min, max, distRepoDir, "test/dummy/0.1-SNAPSHOT/maven-metadata.xml" );
-        assertUpdatedFile( min, max, distRepoDir, "test/other/0.1-SNAPSHOT/maven-metadata.xml" );
-    }
-
-    public void testDeployAttachedArtifact()
-    {
-        executeTarget( "testDeployAttachedArtifact" );
-
-        assertLogContaining( "Uploading" );
-
-        File dir = new File(distRepoDir, "test/dummy/0.1-SNAPSHOT/" );
-        String[] files = dir.list();
-        assertThat( "attached artifact not found: " + Arrays.toString( files ), files,
-                    hasItemInArray( endsWith( "-ant.xml" ) ) );
-    }
-
-    private void assertUpdatedFile( long min, long max, File repoPath, String path )
-    {
-        File file = new File( repoPath, path );
-        min = (min / 1000) * 1000;
-        max = ((max + 999) / 1000) * 1000;
-        assertThat( "File does not exist in default repo: " + file.getAbsolutePath(), file.exists() );
-        assertThat( "Files were not updated for 1s before/after timestamp", file.lastModified(),
-                    allOf( greaterThanOrEqualTo( min ), lessThanOrEqualTo( max ) ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/InstallTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/InstallTest.java b/src/test/java/org/apache/maven/aether/internal/ant/InstallTest.java
deleted file mode 100644
index a445853..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/InstallTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 static org.hamcrest.MatcherAssert.*;
-import static org.hamcrest.Matchers.*;
-
-import java.io.File;
-import java.io.IOException;
-
-public class InstallTest
-    extends AntBuildsTest
-{
-
-    public void testInstallGlobalPom()
-    {
-        executeTarget( "testInstallGlobalPom" );
-        long tstamp = System.currentTimeMillis();
-
-        assertLogContaining( "Installing" );
-        
-        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
-    }
-
-    public void testInstallOverrideGlobalPom()
-    {
-        executeTarget( "testInstallOverrideGlobalPom" );
-        long tstamp = System.currentTimeMillis();
-
-        assertLogContaining( "Installing" );
-
-        assertUpdatedFile( tstamp, localRepoDir, "test/other/0.1-SNAPSHOT/other-0.1-SNAPSHOT.pom" );
-    }
-
-    public void testInstallOverrideGlobalPomByRef()
-    {
-        long tstamp = System.currentTimeMillis();
-        executeTarget( "testInstallOverrideGlobalPomByRef" );
-
-        assertLogContaining( "Installing" );
-
-        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
-        assertUpdatedFile( tstamp, localRepoDir, "test/other/0.1-SNAPSHOT/other-0.1-SNAPSHOT.pom" );
-    }
-
-    public void testDefaultRepo()
-    {
-        executeTarget( "testDefaultRepo" );
-        long tstamp = System.currentTimeMillis();
-
-        assertLogContaining( "Installing" );
-
-        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
-        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT-ant.xml" );
-    }
-
-    public void testCustomRepo()
-        throws IOException
-    {
-        File repoPath = new File( BUILD_DIR, "local-repo-custom" );
-
-        executeTarget( "testCustomRepo" );
-        long tstamp = System.currentTimeMillis();
-
-        System.out.println( getLog() );
-        assertLogContaining( "Installing" );
-
-        assertUpdatedFile( tstamp, repoPath, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
-        assertUpdatedFile( tstamp, repoPath, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT-ant.xml" );
-    }
-
-    private void assertUpdatedFile( long tstamp, File repoPath, String path )
-    {
-        File file = new File( repoPath, path );
-        assertThat( "File does not exist in default repo: " + file.getAbsolutePath(), file.exists() );
-        assertThat( "Files were not updated for 1s before/after timestamp",
-                    file.lastModified(),
-                    allOf( greaterThanOrEqualTo( ( ( tstamp - 500 ) / 1000 ) * 1000 ),
-                           lessThanOrEqualTo( tstamp + 2000 ) ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReaderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReaderTest.java b/src/test/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReaderTest.java
deleted file mode 100644
index f3972ba..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/ProjectWorkspaceReaderTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-
-import org.apache.maven.aether.internal.ant.types.Pom;
-import org.apache.tools.ant.Project;
-import org.junit.Before;
-import org.junit.Test;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.DefaultArtifact;
-
-public class ProjectWorkspaceReaderTest
-{
-
-    private ProjectWorkspaceReader reader;
-
-    private Project project;
-
-    @Before
-    public void setUp()
-        throws Exception
-    {
-        this.reader = new ProjectWorkspaceReader();
-
-        this.project = new Project();
-        project.setProperty( "user.home", System.getProperty( "user.home" ) );
-    }
-
-    private Artifact artifact( String coords )
-    {
-        return new DefaultArtifact( coords );
-    }
-
-    private File getFile( String name )
-    {
-        return new File( "src/test/resources/ProjectWorkspaceReader", name );
-    }
-
-    @Test
-    public void testFindPom()
-    {
-        Pom pom = new Pom();
-        pom.setProject( project );
-        pom.setFile( getFile( "dummy-pom.xml" ) );
-
-        reader.addPom( pom );
-
-        assertEquals( pom.getFile(), reader.findArtifact( artifact( "test:dummy:pom:0.1-SNAPSHOT" ) ) );
-        assertNull( reader.findArtifact( artifact( "unavailable:test:pom:0.1-SNAPSHOT" ) ) );
-    }
-
-    @Test
-    public void testFindArtifact()
-    {
-        Pom pom = new Pom();
-        pom.setProject( project );
-        pom.setFile( getFile( "dummy-pom.xml" ) );
-
-        reader.addPom( pom );
-
-        org.apache.maven.aether.internal.ant.types.Artifact artifact = new org.apache.maven.aether.internal.ant.types.Artifact();
-        artifact.setProject( project );
-        artifact.addPom( pom );
-        artifact.setFile( getFile( "dummy-file.txt" ) );
-
-        reader.addArtifact( artifact );
-
-        assertEquals( artifact.getFile(), reader.findArtifact( artifact( "test:dummy:txt:0.1-SNAPSHOT" ) ) );
-        assertNull( reader.findArtifact( artifact( "unavailable:test:jar:0.1-SNAPSHOT" ) ) );
-    }
-
-    @Test
-    public void testFindVersions()
-    {
-        Pom pom1 = new Pom();
-        pom1.setProject( project );
-        pom1.setCoords( "test:dummy:1-SNAPSHOT" );
-
-        org.apache.maven.aether.internal.ant.types.Artifact artifact1 = new org.apache.maven.aether.internal.ant.types.Artifact();
-        artifact1.setProject( project );
-        artifact1.addPom( pom1 );
-        artifact1.setFile( getFile( "dummy-file.txt" ) );
-
-        reader.addArtifact( artifact1 );
-
-        Pom pom2 = new Pom();
-        pom2.setProject( project );
-        pom2.setCoords( "test:dummy:2-SNAPSHOT" );
-
-        org.apache.maven.aether.internal.ant.types.Artifact artifact2 = new org.apache.maven.aether.internal.ant.types.Artifact();
-        artifact2.setProject( project );
-        artifact2.addPom( pom2 );
-        artifact2.setFile( getFile( "dummy-file.txt" ) );
-
-        reader.addArtifact( artifact2 );
-
-        assertThat( reader.findVersions( artifact( "test:dummy:txt:[0,)" ) ),
-                    containsInAnyOrder( "1-SNAPSHOT", "2-SNAPSHOT" ) );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/ReactorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/ReactorTest.java b/src/test/java/org/apache/maven/aether/internal/ant/ReactorTest.java
deleted file mode 100644
index 86a0ad5..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/ReactorTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.File;
-import java.io.IOException;
-
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.DefaultArtifact;
-
-public class ReactorTest
-    extends AntBuildsTest
-{
-
-    private Artifact artifact( String coords )
-    {
-        return new DefaultArtifact( coords );
-    }
-
-    public void testPom()
-        throws IOException
-    {
-        executeTarget( "testPom" );
-        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
-        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
-        assertNotNull( found );
-        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
-    }
-
-    public void testArtifact()
-        throws IOException
-    {
-        executeTarget( "testArtifact" );
-        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
-        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
-        assertNotNull( found );
-        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
-
-        found = reader.findArtifact( artifact( "test:test:xml:0.1-SNAPSHOT" ) );
-        assertNotNull( found );
-        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
-    }
-
-    public void testArtifactInMemoryPom()
-        throws IOException
-    {
-        executeTarget( "testArtifactInMemoryPom" );
-        ProjectWorkspaceReader reader = ProjectWorkspaceReader.getInstance();
-        File found = reader.findArtifact( artifact( "test:test:pom:0.1-SNAPSHOT" ) );
-        assertNull( found );
-
-        found = reader.findArtifact( artifact( "test:test:xml:0.1-SNAPSHOT" ) );
-        assertNotNull( found );
-        assertEquals( new File( projectDir, "pom1.xml" ), found.getAbsoluteFile() );
-    }
-
-    public void testResolveArtifact()
-        throws IOException
-    {
-        executeTarget( "testResolveArtifact" );
-        String prop = project.getProperty( "resolve.test:test:jar" );
-        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
-    }
-
-    public void testResolveArtifactInMemoryPom()
-        throws IOException
-    {
-        executeTarget( "testResolveArtifactInMemoryPom" );
-        String prop = project.getProperty( "resolve.test:test:jar" );
-        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
-        assertLogContaining( "The POM for test:test:jar:0.1-SNAPSHOT is missing, no dependency information available" );
-    }
-
-    public void testResolveVersionRange()
-        throws IOException
-    {
-        executeTarget( "testResolveVersionRange" );
-        String prop = project.getProperty( "resolve.test:test:jar" );
-        assertEquals( new File( projectDir, "pom1.xml" ).getAbsolutePath(), prop );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/ResolveTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/ResolveTest.java b/src/test/java/org/apache/maven/aether/internal/ant/ResolveTest.java
deleted file mode 100644
index 5b41e27..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/ResolveTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 static org.hamcrest.MatcherAssert.*;
-import static org.hamcrest.Matchers.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.ResourceCollection;
-import org.apache.tools.ant.types.resources.FileResource;
-
-public class ResolveTest
-    extends AntBuildsTest
-{
-
-    public void testResolveGlobalPom()
-    {
-        executeTarget( "testResolveGlobalPom" );
-
-        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
-        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
-        assertThat( "aether-api was not resolved to default local repository", prop,
-                    allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) );
-    }
-
-    public void testResolveOverrideGlobalPom()
-    {
-        executeTarget( "testResolveOverrideGlobalPom" );
-
-        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
-        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
-        assertThat( "aether-api was not resolved to default local repository", prop,
-                    allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) );
-    }
-
-    public void testResolveGlobalPomIntoOtherLocalRepo()
-    {
-        executeTarget( "testResolveGlobalPomIntoOtherLocalRepo" );
-
-        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
-        assertThat( "aether-api was not resolved as a property", prop, notNullValue() );
-        assertThat( "aether-api was not resolved to default local repository", prop.replace( '\\', '/' ),
-                    endsWith( "local-repo-custom/org/eclipse/aether/aether-api/0.9.0.M3/aether-api-0.9.0.M3.jar" ) );
-    }
-
-    public void testResolveCustomFileLayout()
-        throws IOException
-    {
-        File dir = new File( BUILD_DIR, "resolve-custom-layout" );
-        executeTarget( "testResolveCustomFileLayout" );
-
-        assertThat( "aether-api was not saved with custom file layout",
-                    new File( dir, "org.eclipse.aether/aether-api/org/eclipse/aether/jar" ).exists() );
-    }
-
-    public void testResolveAttachments()
-        throws IOException
-    {
-        File dir = new File( BUILD_DIR, "resolve-attachments" );
-        executeTarget( "testResolveAttachments" );
-        
-        File jdocDir = new File(dir, "javadoc");
-        
-        assertThat( "aether-api-javadoc was not saved with custom file layout",
-                    new File( jdocDir, "org.eclipse.aether-aether-api-javadoc.jar" ).exists() );
-
-        assertThat( "found non-javadoc files", Arrays.asList( jdocDir.list() ), everyItem( endsWith( "javadoc.jar" ) ) );
-
-        File sourcesDir = new File( dir, "sources" );
-        assertThat( "aether-api-sources was not saved with custom file layout",
-                    new File( sourcesDir, "org.eclipse.aether-aether-api-sources.jar" ).exists() );
-        assertThat( "found non-sources files", Arrays.asList( sourcesDir.list() ),
-                    everyItem( endsWith( "sources.jar" ) ) );
-    }
-
-    public void testResolvePath()
-    {
-        executeTarget( "testResolvePath" );
-        Map<?, ?> refs = getProject().getReferences();
-        Object obj = refs.get( "out" );
-        assertThat( "ref 'out' is no path", obj, instanceOf( Path.class ) );
-        Path path = (Path) obj;
-        String[] elements = path.list();
-        assertThat( "no aether-api on classpath", elements,
-                    hasItemInArray( allOf( containsString( "aether-api" ), endsWith( ".jar" ) ) ) );
-    }
-
-    public void testResolveDepsFromFile()
-    {
-        executeTarget( "testResolveDepsFromFile" );
-
-        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-spi:jar" );
-        assertThat( "aether-spi was not resolved as a property", prop, notNullValue() );
-        assertThat( "aether-spi was not resolved to default local repository", prop,
-                    allOf( containsString( "aether-spi" ), endsWith( ".jar" ) ) );
-        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
-        assertThat( "aether-api was resolved as a property", prop, nullValue() );
-    }
-
-    public void testResolveNestedDependencyCollections()
-    {
-        executeTarget( "testResolveNestedDependencyCollections" );
-
-        String prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-spi:jar" );
-        assertThat( "aether-spi was not resolved as a property", prop, notNullValue() );
-        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-util:jar" );
-        assertThat( "aether-util was not resolved as a property", prop, notNullValue() );
-        prop = getProject().getProperty( "test.resolve.path.org.eclipse.aether:aether-api:jar" );
-        assertThat( "aether-api was resolved as a property", prop, nullValue() );
-    }
-
-    public void testResolveResourceCollectionOnly()
-    {
-        executeTarget( "testResolveResourceCollectionOnly" );
-
-        ResourceCollection resources = (ResourceCollection) getProject().getReference( "files" );
-        assertThat( resources, is( notNullValue() ) );
-        assertThat( resources.size(), is( 2 ) );
-        assertThat( resources.isFilesystemOnly(), is( true ) );
-        Iterator<?> it = resources.iterator();
-        FileResource file = (FileResource) it.next();
-        assertThat( file.getFile().getName(), is( "aether-spi-0.9.0.v20140226.jar" ) );
-        file = (FileResource) it.next();
-        assertThat( file.getFile().getName(), is( "aether-api-0.9.0.v20140226.jar" ) );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/SettingsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/SettingsTest.java b/src/test/java/org/apache/maven/aether/internal/ant/SettingsTest.java
deleted file mode 100644
index 94a90a2..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/SettingsTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 static org.hamcrest.MatcherAssert.*;
-import static org.hamcrest.Matchers.*;
-
-import java.io.File;
-import java.io.IOException;
-
-public class SettingsTest
-    extends AntBuildsTest
-{
-
-    public void testUserSettings()
-    {
-        executeTarget( "testUserSettings" );
-        assertThat( "user settings not set", AntRepoSys.getInstance( getProject() ).getUserSettings().getName(),
-                    equalTo( "userSettings.xml" ) );
-    }
-
-    public void testGlobalSettings()
-    {
-        executeTarget( "testGlobalSettings" );
-        assertThat( "global settings not set", AntRepoSys.getInstance( getProject() ).getGlobalSettings().getName(),
-                    equalTo( "globalSettings.xml" ) );
-    }
-
-    public void testBothSettings()
-    {
-        executeTarget( "testBothSettings" );
-        assertThat( "global settings not set", AntRepoSys.getInstance( getProject() ).getGlobalSettings().getName(),
-                    equalTo( "globalSettings.xml" ) );
-        assertThat( "user settings not set", AntRepoSys.getInstance( getProject() ).getUserSettings().getName(),
-                    equalTo( "userSettings.xml" ) );
-    }
-
-    public void testFallback()
-        throws IOException
-    {
-        executeTarget("setUp");
-        assertThat( "no fallback to local settings",
-                    AntRepoSys.getInstance( getProject() ).getUserSettings().getAbsolutePath(), endsWith( ".m2"
-                        + File.separator + "settings.xml" ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/tasks/LayoutTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/tasks/LayoutTest.java b/src/test/java/org/apache/maven/aether/internal/ant/tasks/LayoutTest.java
deleted file mode 100644
index 85ca36f..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/tasks/LayoutTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.maven.aether.internal.ant.tasks;
-
-/*
- * 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 static org.junit.Assert.assertEquals;
-
-import org.apache.tools.ant.BuildException;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.junit.Test;
-
-/**
- */
-public class LayoutTest
-{
-
-    @Test( expected = BuildException.class )
-    public void testUnknownVariable()
-    {
-        new Layout( "{unknown}" );
-    }
-
-    @Test
-    public void testGetPath()
-    {
-        Layout layout;
-
-        layout =
-            new Layout( "{groupIdDirs}/{artifactId}/{baseVersion}/{artifactId}-{version}-{classifier}.{extension}" );
-        assertEquals( "org/apache/maven/maven-model/3.0-SNAPSHOT/maven-model-3.0-20100720.132618-1.jar",
-                      layout.getPath( new DefaultArtifact( "org.apache.maven:maven-model:3.0-20100720.132618-1" ) ) );
-
-        layout = new Layout( "{groupId}/{artifactId}-{version}-{classifier}.{extension}" );
-        assertEquals( "org.apache.maven/maven-model-3.0-sources.jar",
-                      layout.getPath( new DefaultArtifact( "org.apache.maven:maven-model:jar:sources:3.0" ) ) );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/types/DependencyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/types/DependencyTest.java b/src/test/java/org/apache/maven/aether/internal/ant/types/DependencyTest.java
deleted file mode 100644
index f5f04aa..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/types/DependencyTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 static org.junit.Assert.*;
-
-import org.junit.Test;
-
-/**
- */
-public class DependencyTest
-{
-
-    @Test
-    public void testSetCoordsGidAidVer()
-    {
-        Dependency dep = new Dependency();
-        dep.setCoords( "gid:aid:ver" );
-
-        assertEquals( "gid", dep.getGroupId() );
-        assertEquals( "aid", dep.getArtifactId() );
-        assertEquals( "ver", dep.getVersion() );
-        assertEquals( "jar", dep.getType() );
-        assertEquals( "", dep.getClassifier() );
-        assertEquals( "compile", dep.getScope() );
-    }
-
-    @Test
-    public void testSetCoordsGidAidVerScope()
-    {
-        Dependency dep = new Dependency();
-        dep.setCoords( "gid:aid:ver:scope" );
-
-        assertEquals( "gid", dep.getGroupId() );
-        assertEquals( "aid", dep.getArtifactId() );
-        assertEquals( "ver", dep.getVersion() );
-        assertEquals( "jar", dep.getType() );
-        assertEquals( "", dep.getClassifier() );
-        assertEquals( "scope", dep.getScope() );
-    }
-
-    @Test
-    public void testSetCoordsGidAidVerTypeScope()
-    {
-        Dependency dep = new Dependency();
-        dep.setCoords( "gid:aid:ver:type:scope" );
-
-        assertEquals( "gid", dep.getGroupId() );
-        assertEquals( "aid", dep.getArtifactId() );
-        assertEquals( "ver", dep.getVersion() );
-        assertEquals( "type", dep.getType() );
-        assertEquals( "", dep.getClassifier() );
-        assertEquals( "scope", dep.getScope() );
-    }
-
-    @Test
-    public void testSetCoordsGidAidVerTypeClsScope()
-    {
-        Dependency dep = new Dependency();
-        dep.setCoords( "gid:aid:ver:type:cls:scope" );
-
-        assertEquals( "gid", dep.getGroupId() );
-        assertEquals( "aid", dep.getArtifactId() );
-        assertEquals( "ver", dep.getVersion() );
-        assertEquals( "type", dep.getType() );
-        assertEquals( "cls", dep.getClassifier() );
-        assertEquals( "scope", dep.getScope() );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/types/ExclusionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/types/ExclusionTest.java b/src/test/java/org/apache/maven/aether/internal/ant/types/ExclusionTest.java
deleted file mode 100644
index a187e7c..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/types/ExclusionTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 static org.junit.Assert.*;
-
-import org.junit.Test;
-
-/**
- */
-public class ExclusionTest
-{
-
-    @Test
-    public void testSetCoordsGid()
-    {
-        Exclusion ex = new Exclusion();
-        ex.setCoords( "gid" );
-
-        assertEquals( "gid", ex.getGroupId() );
-        assertEquals( "*", ex.getArtifactId() );
-        assertEquals( "*", ex.getExtension() );
-        assertEquals( "*", ex.getClassifier() );
-    }
-
-    @Test
-    public void testSetCoordsGidAid()
-    {
-        Exclusion ex = new Exclusion();
-        ex.setCoords( "gid:aid" );
-
-        assertEquals( "gid", ex.getGroupId() );
-        assertEquals( "aid", ex.getArtifactId() );
-        assertEquals( "*", ex.getExtension() );
-        assertEquals( "*", ex.getClassifier() );
-    }
-
-    @Test
-    public void testSetCoordsGidAidExt()
-    {
-        Exclusion ex = new Exclusion();
-        ex.setCoords( "gid:aid:ext" );
-
-        assertEquals( "gid", ex.getGroupId() );
-        assertEquals( "aid", ex.getArtifactId() );
-        assertEquals( "ext", ex.getExtension() );
-        assertEquals( "*", ex.getClassifier() );
-    }
-
-    @Test
-    public void testSetCoordsGidAidExtCls()
-    {
-        Exclusion ex = new Exclusion();
-        ex.setCoords( "gid:aid:ext:cls" );
-
-        assertEquals( "gid", ex.getGroupId() );
-        assertEquals( "aid", ex.getArtifactId() );
-        assertEquals( "ext", ex.getExtension() );
-        assertEquals( "cls", ex.getClassifier() );
-
-        ex = new Exclusion();
-        ex.setCoords( "gid:aid:ext:" );
-
-        assertEquals( "gid", ex.getGroupId() );
-        assertEquals( "aid", ex.getArtifactId() );
-        assertEquals( "ext", ex.getExtension() );
-        assertEquals( "", ex.getClassifier() );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/aether/internal/ant/types/PomTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/aether/internal/ant/types/PomTest.java b/src/test/java/org/apache/maven/aether/internal/ant/types/PomTest.java
deleted file mode 100644
index 8ca1fae..0000000
--- a/src/test/java/org/apache/maven/aether/internal/ant/types/PomTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 static org.junit.Assert.*;
-
-import org.junit.Test;
-
-/**
- */
-public class PomTest
-{
-
-    @Test
-    public void testSetCoordsGid()
-    {
-        Pom pom = new Pom();
-        pom.setCoords( "gid:aid:ver" );
-
-        assertEquals( "gid", pom.getGroupId() );
-        assertEquals( "aid", pom.getArtifactId() );
-        assertEquals( "ver", pom.getVersion() );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/AntBuildsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/AntBuildsTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/AntBuildsTest.java
new file mode 100644
index 0000000..aaf73da
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/AntBuildsTest.java
@@ -0,0 +1,124 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.File;
+import java.io.PrintStream;
+
+import org.apache.maven.resolver.internal.ant.ProjectWorkspaceReader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.BuildFileTest;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.eclipse.aether.internal.test.util.TestFileUtils;
+
+public abstract class AntBuildsTest
+    extends BuildFileTest
+{
+
+    private static final File BASE_DIR;
+
+    protected static final File BUILD_DIR;
+
+    static
+    {
+        BASE_DIR = new File( "" ).getAbsoluteFile();
+        BUILD_DIR = new File( BASE_DIR, "target/ant" );
+    }
+
+    protected File projectDir;
+
+    protected File localRepoDir;
+
+    protected File distRepoDir;
+
+    protected String getProjectDirName()
+    {
+        String name = getClass().getSimpleName();
+        if ( name.endsWith( "Test" ) )
+        {
+            name = name.substring( 0, name.length() - 4 );
+        }
+        return name;
+    }
+
+    protected void setUpProperties()
+        throws Exception
+    {
+        // hook for subclasses to set further system properties for the project to pick up
+    }
+
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        TestFileUtils.deleteFile( BUILD_DIR );
+
+        projectDir = new File( new File( BASE_DIR, "src/test/resources/ant" ), getProjectDirName() );
+        localRepoDir = new File( BUILD_DIR, "local-repo" );
+        distRepoDir = new File( BUILD_DIR, "dist-repo" );
+
+        System.setProperty( "project.dir", projectDir.getAbsolutePath() );
+        System.setProperty( "build.dir", BUILD_DIR.getAbsolutePath() );
+        System.setProperty( "maven.repo.local", localRepoDir.getAbsolutePath() );
+        System.setProperty( "project.distrepo.url", distRepoDir.toURI().toString() );
+        setUpProperties();
+
+        configureProject( new File( projectDir, "ant.xml" ).getAbsolutePath(), Project.MSG_VERBOSE );
+    }
+
+    @Override
+    protected void tearDown()
+        throws Exception
+    {
+        try
+        {
+            ProjectWorkspaceReader.dropInstance();
+            TestFileUtils.deleteFile( BUILD_DIR );
+        }
+        finally
+        {
+            super.tearDown();
+        }
+    }
+
+    @Override
+    public void configureProject( String filename, int logLevel )
+        throws BuildException
+    {
+        super.configureProject( filename, logLevel );
+        DefaultLogger logger = new DefaultLogger()
+        {
+            @Override
+            protected void printMessage( String message, PrintStream stream, int priority )
+            {
+                message = System.currentTimeMillis() + " " + message;
+                super.printMessage( message, stream, priority );
+            }
+        };
+        logger.setMessageOutputLevel( logLevel );
+        logger.setOutputPrintStream( System.out );
+        logger.setErrorPrintStream( System.err );
+        getProject().addBuildListener( logger );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/DeployTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/DeployTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/DeployTest.java
new file mode 100644
index 0000000..203bdba
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/DeployTest.java
@@ -0,0 +1,91 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+
+import java.io.File;
+import java.util.Arrays;
+
+/*
+ * still missing:
+ * - deploy snapshots/releases into correct repos
+ */
+public class DeployTest
+    extends AntBuildsTest
+{
+
+    public void testDeployGlobalPom()
+    {
+        long min = System.currentTimeMillis();
+        executeTarget( "testDeployGlobalPom" );
+        long max = System.currentTimeMillis();
+
+        assertLogContaining( "Uploading" );
+        
+        assertUpdatedFile( min, max, distRepoDir, "test/dummy/0.1-SNAPSHOT/maven-metadata.xml" );
+    }
+
+    public void testDeployOverrideGlobalPom()
+    {
+        long min = System.currentTimeMillis();
+        executeTarget( "testDeployOverrideGlobalPom" );
+        long max = System.currentTimeMillis();
+
+        assertLogContaining( "Uploading" );
+
+        assertUpdatedFile( min, max, distRepoDir, "test/other/0.1-SNAPSHOT/maven-metadata.xml" );
+    }
+
+    public void testDeployOverrideGlobalPomByRef()
+    {
+        long min = System.currentTimeMillis();
+        executeTarget( "testDeployOverrideGlobalPomByRef" );
+        long max = System.currentTimeMillis();
+
+        assertLogContaining( "Uploading" );
+
+        assertUpdatedFile( min, max, distRepoDir, "test/dummy/0.1-SNAPSHOT/maven-metadata.xml" );
+        assertUpdatedFile( min, max, distRepoDir, "test/other/0.1-SNAPSHOT/maven-metadata.xml" );
+    }
+
+    public void testDeployAttachedArtifact()
+    {
+        executeTarget( "testDeployAttachedArtifact" );
+
+        assertLogContaining( "Uploading" );
+
+        File dir = new File(distRepoDir, "test/dummy/0.1-SNAPSHOT/" );
+        String[] files = dir.list();
+        assertThat( "attached artifact not found: " + Arrays.toString( files ), files,
+                    hasItemInArray( endsWith( "-ant.xml" ) ) );
+    }
+
+    private void assertUpdatedFile( long min, long max, File repoPath, String path )
+    {
+        File file = new File( repoPath, path );
+        min = (min / 1000) * 1000;
+        max = ((max + 999) / 1000) * 1000;
+        assertThat( "File does not exist in default repo: " + file.getAbsolutePath(), file.exists() );
+        assertThat( "Files were not updated for 1s before/after timestamp", file.lastModified(),
+                    allOf( greaterThanOrEqualTo( min ), lessThanOrEqualTo( max ) ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/test/java/org/apache/maven/resolver/internal/ant/InstallTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/InstallTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/InstallTest.java
new file mode 100644
index 0000000..bd3fcaa
--- /dev/null
+++ b/src/test/java/org/apache/maven/resolver/internal/ant/InstallTest.java
@@ -0,0 +1,98 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+
+import java.io.File;
+import java.io.IOException;
+
+public class InstallTest
+    extends AntBuildsTest
+{
+
+    public void testInstallGlobalPom()
+    {
+        executeTarget( "testInstallGlobalPom" );
+        long tstamp = System.currentTimeMillis();
+
+        assertLogContaining( "Installing" );
+        
+        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
+    }
+
+    public void testInstallOverrideGlobalPom()
+    {
+        executeTarget( "testInstallOverrideGlobalPom" );
+        long tstamp = System.currentTimeMillis();
+
+        assertLogContaining( "Installing" );
+
+        assertUpdatedFile( tstamp, localRepoDir, "test/other/0.1-SNAPSHOT/other-0.1-SNAPSHOT.pom" );
+    }
+
+    public void testInstallOverrideGlobalPomByRef()
+    {
+        long tstamp = System.currentTimeMillis();
+        executeTarget( "testInstallOverrideGlobalPomByRef" );
+
+        assertLogContaining( "Installing" );
+
+        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
+        assertUpdatedFile( tstamp, localRepoDir, "test/other/0.1-SNAPSHOT/other-0.1-SNAPSHOT.pom" );
+    }
+
+    public void testDefaultRepo()
+    {
+        executeTarget( "testDefaultRepo" );
+        long tstamp = System.currentTimeMillis();
+
+        assertLogContaining( "Installing" );
+
+        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
+        assertUpdatedFile( tstamp, localRepoDir, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT-ant.xml" );
+    }
+
+    public void testCustomRepo()
+        throws IOException
+    {
+        File repoPath = new File( BUILD_DIR, "local-repo-custom" );
+
+        executeTarget( "testCustomRepo" );
+        long tstamp = System.currentTimeMillis();
+
+        System.out.println( getLog() );
+        assertLogContaining( "Installing" );
+
+        assertUpdatedFile( tstamp, repoPath, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT.pom" );
+        assertUpdatedFile( tstamp, repoPath, "test/dummy/0.1-SNAPSHOT/dummy-0.1-SNAPSHOT-ant.xml" );
+    }
+
+    private void assertUpdatedFile( long tstamp, File repoPath, String path )
+    {
+        File file = new File( repoPath, path );
+        assertThat( "File does not exist in default repo: " + file.getAbsolutePath(), file.exists() );
+        assertThat( "Files were not updated for 1s before/after timestamp",
+                    file.lastModified(),
+                    allOf( greaterThanOrEqualTo( ( ( tstamp - 500 ) / 1000 ) * 1000 ),
+                           lessThanOrEqualTo( tstamp + 2000 ) ) );
+    }
+}


[4/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntRepoSys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntRepoSys.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntRepoSys.java
new file mode 100644
index 0000000..3b158e4
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntRepoSys.java
@@ -0,0 +1,825 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.building.DefaultModelBuilderFactory;
+import org.apache.maven.model.building.DefaultModelBuildingRequest;
+import org.apache.maven.model.building.FileModelSource;
+import org.apache.maven.model.building.ModelBuilder;
+import org.apache.maven.model.building.ModelBuildingException;
+import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.resolution.ModelResolver;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.apache.maven.resolver.internal.ant.types.Artifact;
+import org.apache.maven.resolver.internal.ant.types.Artifacts;
+import org.apache.maven.resolver.internal.ant.types.Authentication;
+import org.apache.maven.resolver.internal.ant.types.Dependencies;
+import org.apache.maven.resolver.internal.ant.types.Dependency;
+import org.apache.maven.resolver.internal.ant.types.DependencyContainer;
+import org.apache.maven.resolver.internal.ant.types.Exclusion;
+import org.apache.maven.resolver.internal.ant.types.LocalRepository;
+import org.apache.maven.resolver.internal.ant.types.Mirror;
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.apache.maven.resolver.internal.ant.types.Proxy;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepositories;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepository;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.building.DefaultSettingsBuilderFactory;
+import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
+import org.apache.maven.settings.building.SettingsBuilder;
+import org.apache.maven.settings.building.SettingsBuildingException;
+import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
+import org.apache.maven.settings.crypto.SettingsDecryptionResult;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.condition.Os;
+import org.apache.tools.ant.types.Reference;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.eclipse.aether.ConfigurationProperties;
+import org.eclipse.aether.DefaultRepositoryCache;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.collection.DependencyCollectionException;
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.impl.DefaultServiceLocator;
+import org.eclipse.aether.impl.RemoteRepositoryManager;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.repository.AuthenticationSelector;
+import org.eclipse.aether.repository.LocalRepositoryManager;
+import org.eclipse.aether.repository.MirrorSelector;
+import org.eclipse.aether.repository.ProxySelector;
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.transport.TransporterFactory;
+import org.eclipse.aether.spi.log.Logger;
+import org.eclipse.aether.transport.classpath.ClasspathTransporterFactory;
+import org.eclipse.aether.transport.file.FileTransporterFactory;
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
+import org.eclipse.aether.util.repository.AuthenticationBuilder;
+import org.eclipse.aether.util.repository.ConservativeAuthenticationSelector;
+import org.eclipse.aether.util.repository.DefaultAuthenticationSelector;
+import org.eclipse.aether.util.repository.DefaultMirrorSelector;
+import org.eclipse.aether.util.repository.DefaultProxySelector;
+
+/**
+ */
+public class AntRepoSys
+{
+
+    private static final boolean OS_WINDOWS = Os.isFamily( "windows" );
+
+    private static final ModelBuilder MODEL_BUILDER = new DefaultModelBuilderFactory().newInstance();
+
+    private static final SettingsBuilder SETTINGS_BUILDER = new DefaultSettingsBuilderFactory().newInstance();
+
+    private static final SettingsDecrypter SETTINGS_DECRYPTER = new AntSettingsDecryptorFactory().newInstance();
+
+    private final Project project;
+
+    private final DefaultServiceLocator locator;
+
+    private RepositorySystem repoSys;
+
+    private RemoteRepositoryManager remoteRepoMan;
+
+    private File userSettings;
+
+    private File globalSettings;
+
+    private Settings settings;
+
+    private final List<Mirror> mirrors = new CopyOnWriteArrayList<Mirror>();
+
+    private final List<Proxy> proxies = new CopyOnWriteArrayList<Proxy>();
+
+    private final List<Authentication> authentications = new CopyOnWriteArrayList<Authentication>();
+
+    private LocalRepository localRepository;
+
+    private Pom defaultPom;
+
+    private static <T> boolean eq( T o1, T o2 )
+    {
+        return ( o1 == null ) ? o2 == null : o1.equals( o2 );
+    }
+
+    public static synchronized AntRepoSys getInstance( Project project )
+    {
+        Object obj = project.getReference( Names.ID );
+        if ( obj instanceof AntRepoSys )
+        {
+            return (AntRepoSys) obj;
+        }
+        AntRepoSys instance = new AntRepoSys( project );
+        project.addReference( Names.ID, instance );
+        instance.initDefaults();
+        return instance;
+    }
+
+    private AntRepoSys( Project project )
+    {
+        this.project = project;
+
+        locator = MavenRepositorySystemUtils.newServiceLocator();
+        locator.setErrorHandler( new AntServiceLocatorErrorHandler( project ) );
+        locator.setServices( Logger.class, new AntLogger( project ) );
+        locator.setServices( ModelBuilder.class, MODEL_BUILDER );
+        locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
+        locator.addService( TransporterFactory.class, FileTransporterFactory.class );
+        locator.addService( TransporterFactory.class, HttpTransporterFactory.class );
+        locator.addService( TransporterFactory.class, ClasspathTransporterFactory.class );
+    }
+
+    private void initDefaults()
+    {
+        RemoteRepository repo = new RemoteRepository();
+        repo.setProject( project );
+        repo.setId( "central" );
+        repo.setUrl( "http://repo1.maven.org/maven2/" );
+        project.addReference( Names.ID_CENTRAL, repo );
+
+        repo = new RemoteRepository();
+        repo.setProject( project );
+        repo.setRefid( new Reference( project, Names.ID_CENTRAL ) );
+        RemoteRepositories repos = new RemoteRepositories();
+        repos.setProject( project );
+        repos.addRemoterepo( repo );
+        project.addReference( Names.ID_DEFAULT_REPOS, repos );
+    }
+
+    public synchronized RepositorySystem getSystem()
+    {
+        if ( repoSys == null )
+        {
+            repoSys = locator.getService( RepositorySystem.class );
+            if ( repoSys == null )
+            {
+                throw new BuildException( "The repository system could not be initialized" );
+            }
+        }
+        return repoSys;
+    }
+
+    private synchronized RemoteRepositoryManager getRemoteRepoMan()
+    {
+        if ( remoteRepoMan == null )
+        {
+            remoteRepoMan = locator.getService( RemoteRepositoryManager.class );
+            if ( remoteRepoMan == null )
+            {
+                throw new BuildException( "The repository system could not be initialized" );
+            }
+        }
+        return remoteRepoMan;
+    }
+
+    public RepositorySystemSession getSession( Task task, LocalRepository localRepo )
+    {
+        DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
+
+        Map<Object, Object> configProps = new LinkedHashMap<Object, Object>();
+        configProps.put( ConfigurationProperties.USER_AGENT, getUserAgent() );
+        configProps.putAll( (Map<?, ?>) project.getProperties() );
+        processServerConfiguration( configProps );
+        session.setConfigProperties( configProps );
+
+        session.setOffline( isOffline() );
+        session.setUserProperties( project.getUserProperties() );
+
+        session.setProxySelector( getProxySelector() );
+        session.setMirrorSelector( getMirrorSelector() );
+        session.setAuthenticationSelector( getAuthSelector() );
+
+        session.setCache( new DefaultRepositoryCache() );
+
+        session.setRepositoryListener( new AntRepositoryListener( task ) );
+        session.setTransferListener( new AntTransferListener( task ) );
+
+        session.setLocalRepositoryManager( getLocalRepoMan( session, localRepo ) );
+
+        session.setWorkspaceReader( ProjectWorkspaceReader.getInstance() );
+
+        return session;
+    }
+
+    private String getUserAgent()
+    {
+        StringBuilder buffer = new StringBuilder( 128 );
+
+        buffer.append( "Apache-Ant/" ).append( project.getProperty( "ant.version" ) );
+        buffer.append( " (" );
+        buffer.append( "Java " ).append( System.getProperty( "java.version" ) );
+        buffer.append( "; " );
+        buffer.append( System.getProperty( "os.name" ) ).append( " " ).append( System.getProperty( "os.version" ) );
+        buffer.append( ")" );
+        buffer.append( " Aether" );
+
+        return buffer.toString();
+    }
+
+    private boolean isOffline()
+    {
+        String prop = project.getProperty( Names.PROPERTY_OFFLINE );
+        if ( prop != null )
+        {
+            return Boolean.parseBoolean( prop );
+        }
+        return getSettings().isOffline();
+    }
+
+    private void processServerConfiguration( Map<Object, Object> configProps )
+    {
+        Settings settings = getSettings();
+        for ( Server server : settings.getServers() )
+        {
+            if ( server.getConfiguration() != null )
+            {
+                Xpp3Dom dom = (Xpp3Dom) server.getConfiguration();
+                for ( int i = dom.getChildCount() - 1; i >= 0; i-- )
+                {
+                    Xpp3Dom child = dom.getChild( i );
+                    if ( "wagonProvider".equals( child.getName() ) )
+                    {
+                        dom.removeChild( i );
+                    }
+                    else if ( "httpHeaders".equals( child.getName() ) )
+                    {
+                        configProps.put( ConfigurationProperties.HTTP_HEADERS + "." + server.getId(),
+                                         getHttpHeaders( child ) );
+                    }
+                }
+
+                configProps.put( "aether.connector.wagon.config." + server.getId(), dom );
+            }
+
+            configProps.put( "aether.connector.perms.fileMode." + server.getId(), server.getFilePermissions() );
+            configProps.put( "aether.connector.perms.dirMode." + server.getId(), server.getDirectoryPermissions() );
+        }
+    }
+
+    private Map<String, String> getHttpHeaders( Xpp3Dom dom )
+    {
+        Map<String, String> headers = new HashMap<String, String>();
+        for ( int i = 0; i < dom.getChildCount(); i++ )
+        {
+            Xpp3Dom child = dom.getChild( i );
+            Xpp3Dom name = child.getChild( "name" );
+            Xpp3Dom value = child.getChild( "value" );
+            if ( name != null && name.getValue() != null )
+            {
+                headers.put( name.getValue(), ( value != null ) ? value.getValue() : null );
+            }
+        }
+        return Collections.unmodifiableMap( headers );
+    }
+
+    private File getDefaultLocalRepoDir()
+    {
+        String dir = project.getProperty( "maven.repo.local" );
+        if ( dir != null )
+        {
+            return project.resolveFile( dir );
+        }
+
+        Settings settings = getSettings();
+        if ( settings.getLocalRepository() != null )
+        {
+            return new File( settings.getLocalRepository() );
+        }
+
+        return new File( new File( project.getProperty( "user.home" ), ".m2" ), "repository" );
+    }
+
+    private LocalRepositoryManager getLocalRepoMan( RepositorySystemSession session, LocalRepository localRepo )
+    {
+        if ( localRepo == null )
+        {
+            localRepo = localRepository;
+        }
+
+        File repoDir;
+        if ( localRepo != null && localRepo.getDir() != null )
+        {
+            repoDir = localRepo.getDir();
+        }
+        else
+        {
+            repoDir = getDefaultLocalRepoDir();
+        }
+
+        org.eclipse.aether.repository.LocalRepository repo =
+            new org.eclipse.aether.repository.LocalRepository( repoDir );
+
+        return getSystem().newLocalRepositoryManager( session, repo );
+    }
+
+    private synchronized Settings getSettings()
+    {
+        if ( settings == null )
+        {
+            DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
+            request.setUserSettingsFile( getUserSettings() );
+            request.setGlobalSettingsFile( getGlobalSettings() );
+            request.setSystemProperties( getSystemProperties() );
+            request.setUserProperties( getUserProperties() );
+
+            try
+            {
+                settings = SETTINGS_BUILDER.build( request ).getEffectiveSettings();
+            }
+            catch ( SettingsBuildingException e )
+            {
+                project.log( "Could not process settings.xml: " + e.getMessage(), e, Project.MSG_WARN );
+            }
+
+            SettingsDecryptionResult result =
+                SETTINGS_DECRYPTER.decrypt( new DefaultSettingsDecryptionRequest( settings ) );
+            settings.setServers( result.getServers() );
+            settings.setProxies( result.getProxies() );
+        }
+        return settings;
+    }
+
+    private ProxySelector getProxySelector()
+    {
+        DefaultProxySelector selector = new DefaultProxySelector();
+
+        for ( Proxy proxy : proxies )
+        {
+            selector.add( ConverterUtils.toProxy( proxy ), proxy.getNonProxyHosts() );
+        }
+
+        Settings settings = getSettings();
+        for ( org.apache.maven.settings.Proxy proxy : settings.getProxies() )
+        {
+            AuthenticationBuilder auth = new AuthenticationBuilder();
+            auth.addUsername( proxy.getUsername() ).addPassword( proxy.getPassword() );
+            selector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(),
+                                                                   proxy.getPort(), auth.build() ),
+                          proxy.getNonProxyHosts() );
+        }
+
+        return selector;
+    }
+
+    private MirrorSelector getMirrorSelector()
+    {
+        DefaultMirrorSelector selector = new DefaultMirrorSelector();
+
+        for ( Mirror mirror : mirrors )
+        {
+            selector.add( mirror.getId(), mirror.getUrl(), mirror.getType(), false, mirror.getMirrorOf(), null );
+        }
+
+        Settings settings = getSettings();
+        for ( org.apache.maven.settings.Mirror mirror : settings.getMirrors() )
+        {
+            selector.add( String.valueOf( mirror.getId() ), mirror.getUrl(), mirror.getLayout(), false,
+                          mirror.getMirrorOf(), mirror.getMirrorOfLayouts() );
+        }
+
+        return selector;
+    }
+
+    private AuthenticationSelector getAuthSelector()
+    {
+        DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector();
+
+        Collection<String> ids = new HashSet<String>();
+        for ( Authentication auth : authentications )
+        {
+            List<String> servers = auth.getServers();
+            if ( !servers.isEmpty() )
+            {
+                org.eclipse.aether.repository.Authentication a = ConverterUtils.toAuthentication( auth );
+                for ( String server : servers )
+                {
+                    if ( ids.add( server ) )
+                    {
+                        selector.add( server, a );
+                    }
+                }
+            }
+        }
+
+        Settings settings = getSettings();
+        for ( Server server : settings.getServers() )
+        {
+            AuthenticationBuilder auth = new AuthenticationBuilder();
+            auth.addUsername( server.getUsername() ).addPassword( server.getPassword() );
+            auth.addPrivateKey( server.getPrivateKey(), server.getPassphrase() );
+            selector.add( server.getId(), auth.build() );
+        }
+
+        return new ConservativeAuthenticationSelector( selector );
+    }
+
+    public synchronized void setUserSettings( File file )
+    {
+        if ( !eq( this.userSettings, file ) )
+        {
+            settings = null;
+        }
+        this.userSettings = file;
+    }
+
+    /* UT */File getUserSettings()
+    {
+        if ( userSettings == null )
+        {
+            userSettings = AetherUtils.findUserSettings( project );
+        }
+        return userSettings;
+    }
+
+    public void setGlobalSettings( File file )
+    {
+        if ( !eq( this.globalSettings, file ) )
+        {
+            settings = null;
+        }
+        this.globalSettings = file;
+    }
+
+    /* UT */File getGlobalSettings()
+    {
+        if ( globalSettings == null )
+        {
+            globalSettings = AetherUtils.findGlobalSettings( project );
+        }
+        return globalSettings;
+    }
+
+    public void addProxy( Proxy proxy )
+    {
+        proxies.add( proxy );
+    }
+
+    public void addMirror( Mirror mirror )
+    {
+        mirrors.add( mirror );
+    }
+
+    public void addAuthentication( Authentication authentication )
+    {
+        authentications.add( authentication );
+    }
+
+    public void setLocalRepository( LocalRepository localRepository )
+    {
+        this.localRepository = localRepository;
+    }
+
+    public Model loadModel( Task task, File pomFile, boolean local, RemoteRepositories remoteRepositories )
+    {
+        RepositorySystemSession session = getSession( task, null );
+
+        remoteRepositories =
+            remoteRepositories == null ? AetherUtils.getDefaultRepositories( project ) : remoteRepositories;
+
+        List<org.eclipse.aether.repository.RemoteRepository> repositories =
+            ConverterUtils.toRepositories( task.getProject(), session, remoteRepositories, getRemoteRepoMan() );
+
+        ModelResolver modelResolver =
+            new AntModelResolver( session, "project", getSystem(), getRemoteRepoMan(), repositories );
+
+        Settings settings = getSettings();
+
+        try
+        {
+            DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
+            request.setLocationTracking( true );
+            request.setProcessPlugins( false );
+            if ( local )
+            {
+                request.setPomFile( pomFile );
+                request.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_STRICT );
+            }
+            else
+            {
+                request.setModelSource( new FileModelSource( pomFile ) );
+                request.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
+            }
+            request.setSystemProperties( getSystemProperties() );
+            request.setUserProperties( getUserProperties() );
+            request.setProfiles( SettingsUtils.convert( settings.getProfiles() ) );
+            request.setActiveProfileIds( settings.getActiveProfiles() );
+            request.setModelResolver( modelResolver );
+            return MODEL_BUILDER.build( request ).getEffectiveModel();
+        }
+        catch ( ModelBuildingException e )
+        {
+            throw new BuildException( "Could not load POM " + pomFile + ": " + e.getMessage(), e );
+        }
+    }
+
+    private Properties getSystemProperties()
+    {
+        Properties props = new Properties();
+        getEnvProperties( props );
+        props.putAll( System.getProperties() );
+        ConverterUtils.addProperties( props, project.getProperties() );
+        return props;
+    }
+
+    private Properties getEnvProperties( Properties props )
+    {
+        if ( props == null )
+        {
+            props = new Properties();
+        }
+        boolean envCaseInsensitive = OS_WINDOWS;
+        for ( Map.Entry<String, String> entry : System.getenv().entrySet() )
+        {
+            String key = entry.getKey();
+            if ( envCaseInsensitive )
+            {
+                key = key.toUpperCase( Locale.ENGLISH );
+            }
+            key = "env." + key;
+            props.put( key, entry.getValue() );
+        }
+        return props;
+    }
+
+    private Properties getUserProperties()
+    {
+        return ConverterUtils.addProperties( null, project.getUserProperties() );
+    }
+
+    /**
+     * Sets the default POM.
+     */
+    public void setDefaultPom( Pom pom )
+    {
+        this.defaultPom = pom;
+    }
+
+    /**
+     * Returns the current default POM.
+     */
+    public Pom getDefaultPom()
+    {
+        return defaultPom;
+    }
+
+    public CollectResult collectDependencies( Task task, Dependencies dependencies, LocalRepository localRepository,
+                                              RemoteRepositories remoteRepositories )
+    {
+        RepositorySystemSession session = getSession( task, localRepository );
+
+        remoteRepositories =
+            remoteRepositories == null ? AetherUtils.getDefaultRepositories( project ) : remoteRepositories;
+
+        List<org.eclipse.aether.repository.RemoteRepository> repos =
+            ConverterUtils.toRepositories( project, session, remoteRepositories, getRemoteRepoMan() );
+
+        CollectRequest collectRequest = new CollectRequest();
+        collectRequest.setRequestContext( "project" );
+
+        for ( org.eclipse.aether.repository.RemoteRepository repo : repos )
+        {
+            task.getProject().log( "Using remote repository " + repo, Project.MSG_VERBOSE );
+            collectRequest.addRepository( repo );
+        }
+
+        if ( dependencies != null )
+        {
+            populateCollectRequest( collectRequest, task, session, dependencies, Collections.<Exclusion>emptyList() );
+        }
+
+        task.getProject().log( "Collecting dependencies", Project.MSG_VERBOSE );
+
+        CollectResult result;
+        try
+        {
+            result = getSystem().collectDependencies( session, collectRequest );
+        }
+        catch ( DependencyCollectionException e )
+        {
+            throw new BuildException( "Could not collect dependencies: " + e.getMessage(), e );
+        }
+
+        return result;
+    }
+
+    private void populateCollectRequest( CollectRequest collectRequest, Task task, RepositorySystemSession session,
+                                         Dependencies dependencies, List<Exclusion> exclusions )
+    {
+        List<Exclusion> globalExclusions = exclusions;
+        if ( !dependencies.getExclusions().isEmpty() )
+        {
+            globalExclusions = new ArrayList<Exclusion>( exclusions );
+            globalExclusions.addAll( dependencies.getExclusions() );
+        }
+
+        Collection<String> ids = new HashSet<String>();
+
+        for ( DependencyContainer container : dependencies.getDependencyContainers() )
+        {
+            if ( container instanceof Dependency )
+            {
+                Dependency dep = (Dependency) container;
+                ids.add( dep.getVersionlessKey() );
+                collectRequest.addDependency( ConverterUtils.toDependency( dep, globalExclusions, session ) );
+            }
+            else
+            {
+                populateCollectRequest( collectRequest, task, session, (Dependencies) container, globalExclusions );
+            }
+        }
+
+        if ( dependencies.getPom() != null )
+        {
+            Model model = dependencies.getPom().getModel( task );
+            for ( org.apache.maven.model.Dependency dep : model.getDependencies() )
+            {
+                Dependency dependency = new Dependency();
+                dependency.setArtifactId( dep.getArtifactId() );
+                dependency.setClassifier( dep.getClassifier() );
+                dependency.setGroupId( dep.getGroupId() );
+                dependency.setScope( dep.getScope() );
+                dependency.setType( dep.getType() );
+                dependency.setVersion( dep.getVersion() );
+                if ( ids.contains( dependency.getVersionlessKey() ) )
+                {
+                    project.log( "Ignoring dependency " + dependency.getVersionlessKey() + " from " + model.getId()
+                        + ", already declared locally", Project.MSG_VERBOSE );
+                    continue;
+                }
+                if ( dep.getSystemPath() != null && dep.getSystemPath().length() > 0 )
+                {
+                    dependency.setSystemPath( task.getProject().resolveFile( dep.getSystemPath() ) );
+                }
+                for ( org.apache.maven.model.Exclusion exc : dep.getExclusions() )
+                {
+                    Exclusion exclusion = new Exclusion();
+                    exclusion.setGroupId( exc.getGroupId() );
+                    exclusion.setArtifactId( exc.getArtifactId() );
+                    exclusion.setClassifier( "*" );
+                    exclusion.setExtension( "*" );
+                    dependency.addExclusion( exclusion );
+                }
+                collectRequest.addDependency( ConverterUtils.toDependency( dependency, globalExclusions, session ) );
+            }
+        }
+
+        if ( dependencies.getFile() != null )
+        {
+            List<Dependency> deps = readDependencies( dependencies.getFile() );
+            for ( Dependency dependency : deps )
+            {
+                if ( ids.contains( dependency.getVersionlessKey() ) )
+                {
+                    project.log( "Ignoring dependency " + dependency.getVersionlessKey() + " from "
+                                     + dependencies.getFile() + ", already declared locally", Project.MSG_VERBOSE );
+                    continue;
+                }
+                collectRequest.addDependency( ConverterUtils.toDependency( dependency, globalExclusions, session ) );
+            }
+        }
+    }
+
+    private List<Dependency> readDependencies( File file )
+    {
+        List<Dependency> dependencies = new ArrayList<Dependency>();
+        try
+        {
+            BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
+            try
+            {
+                for ( String line = reader.readLine(); line != null; line = reader.readLine() )
+                {
+                    int comment = line.indexOf( '#' );
+                    if ( comment >= 0 )
+                    {
+                        line = line.substring( 0, comment );
+                    }
+                    line = line.trim();
+                    if ( line.length() <= 0 )
+                    {
+                        continue;
+                    }
+                    Dependency dependency = new Dependency();
+                    dependency.setCoords( line );
+                    dependencies.add( dependency );
+                }
+            }
+            finally
+            {
+                reader.close();
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new BuildException( "Cannot read " + file, e );
+        }
+        return dependencies;
+    }
+
+    public void install( Task task, Pom pom, Artifacts artifacts )
+    {
+        RepositorySystemSession session = getSession( task, null );
+
+        InstallRequest request = new InstallRequest();
+        request.setArtifacts( toArtifacts( task, session, pom, artifacts ) );
+
+        try
+        {
+            getSystem().install( session, request );
+        }
+        catch ( InstallationException e )
+        {
+            throw new BuildException( "Could not install artifacts: " + e.getMessage(), e );
+        }
+    }
+
+    public void deploy( Task task, Pom pom, Artifacts artifacts, RemoteRepository releaseRepository,
+                        RemoteRepository snapshotRepository )
+    {
+        RepositorySystemSession session = getSession( task, null );
+
+        DeployRequest request = new DeployRequest();
+        request.setArtifacts( toArtifacts( task, session, pom, artifacts ) );
+        boolean snapshot = request.getArtifacts().iterator().next().isSnapshot();
+        RemoteRepository distRepo = ( snapshot && snapshotRepository != null ) ? snapshotRepository : releaseRepository;
+        request.setRepository( ConverterUtils.toDistRepository( distRepo, session ) );
+
+        try
+        {
+            getSystem().deploy( session, request );
+        }
+        catch ( DeploymentException e )
+        {
+            throw new BuildException( "Could not deploy artifacts: " + e.getMessage(), e );
+        }
+    }
+
+    private List<org.eclipse.aether.artifact.Artifact> toArtifacts( Task task, RepositorySystemSession session,
+                                                                    Pom pom, Artifacts artifacts )
+    {
+        Model model = pom.getModel( task );
+        File pomFile = pom.getFile();
+
+        List<org.eclipse.aether.artifact.Artifact> results = new ArrayList<org.eclipse.aether.artifact.Artifact>();
+
+        org.eclipse.aether.artifact.Artifact pomArtifact =
+            new DefaultArtifact( model.getGroupId(), model.getArtifactId(), "pom", model.getVersion() ).setFile( pomFile );
+        results.add( pomArtifact );
+
+        for ( Artifact artifact : artifacts.getArtifacts() )
+        {
+            org.eclipse.aether.artifact.Artifact buildArtifact =
+                new DefaultArtifact( model.getGroupId(), model.getArtifactId(), artifact.getClassifier(),
+                                     artifact.getType(), model.getVersion() ).setFile( artifact.getFile() );
+            results.add( buildArtifact );
+        }
+
+        return results;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntRepositoryListener.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntRepositoryListener.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntRepositoryListener.java
new file mode 100644
index 0000000..f850357
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntRepositoryListener.java
@@ -0,0 +1,123 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.FileNotFoundException;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.eclipse.aether.AbstractRepositoryListener;
+import org.eclipse.aether.RepositoryEvent;
+import org.eclipse.aether.transfer.MetadataNotFoundException;
+
+/**
+ * Logs repository events like installed and unresolved artifacts and metadata.
+ */
+class AntRepositoryListener
+    extends AbstractRepositoryListener
+{
+
+    private Task task;
+
+    public AntRepositoryListener( Task task )
+    {
+        this.task = task;
+    }
+
+    @Override
+    public void artifactInstalling( RepositoryEvent event )
+    {
+        task.log( "Installing " + event.getArtifact().getFile() + " to " + event.getFile() );
+    }
+
+    @Override
+    public void metadataInstalling( RepositoryEvent event )
+    {
+        task.log( "Installing " + event.getMetadata() + " to " + event.getFile() );
+    }
+
+    @Override
+    public void metadataResolved( RepositoryEvent event )
+    {
+        Exception e = event.getException();
+        if ( e != null )
+        {
+            if ( e instanceof MetadataNotFoundException )
+            {
+                task.log( e.getMessage(), Project.MSG_DEBUG );
+            }
+            else
+            {
+                task.log( e.getMessage(), e, Project.MSG_WARN );
+            }
+        }
+    }
+
+    @Override
+    public void metadataInvalid( RepositoryEvent event )
+    {
+        Exception exception = event.getException();
+
+        StringBuilder buffer = new StringBuilder( 256 );
+        buffer.append( "The metadata " );
+        if ( event.getMetadata().getFile() != null )
+        {
+            buffer.append( event.getMetadata().getFile() );
+        }
+        else
+        {
+            buffer.append( event.getMetadata() );
+        }
+
+        if ( exception instanceof FileNotFoundException )
+        {
+            buffer.append( " is inaccessible" );
+        }
+        else
+        {
+            buffer.append( " is invalid" );
+        }
+
+        if ( exception != null )
+        {
+            buffer.append( ": " );
+            buffer.append( exception.getMessage() );
+        }
+
+        task.log( buffer.toString(), exception, Project.MSG_WARN );
+    }
+
+    @Override
+    public void artifactDescriptorInvalid( RepositoryEvent event )
+    {
+        task.log( "The POM for " + event.getArtifact() + " is invalid"
+                      + ", transitive dependencies (if any) will not be available: "
+                      + event.getException().getMessage(),
+                  event.getException(), Project.MSG_WARN );
+    };
+
+    @Override
+    public void artifactDescriptorMissing( RepositoryEvent event )
+    {
+        task.log( "The POM for " + event.getArtifact() + " is missing, no dependency information available",
+                  Project.MSG_WARN );
+    };
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntSecDispatcher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntSecDispatcher.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntSecDispatcher.java
new file mode 100644
index 0000000..0852f86
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntSecDispatcher.java
@@ -0,0 +1,45 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.cipher.PlexusCipherException;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+
+/**
+ */
+class AntSecDispatcher
+    extends DefaultSecDispatcher
+{
+
+    public AntSecDispatcher()
+    {
+        _configurationFile = "~/.m2/settings-security.xml";
+        try
+        {
+            _cipher = new DefaultPlexusCipher();
+        }
+        catch ( PlexusCipherException e )
+        {
+            e.printStackTrace();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntServiceLocatorErrorHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntServiceLocatorErrorHandler.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntServiceLocatorErrorHandler.java
new file mode 100644
index 0000000..1621285
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntServiceLocatorErrorHandler.java
@@ -0,0 +1,50 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 org.apache.tools.ant.Project;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.impl.DefaultServiceLocator;
+
+/**
+ */
+class AntServiceLocatorErrorHandler
+    extends DefaultServiceLocator.ErrorHandler
+{
+
+    private Project project;
+
+    public AntServiceLocatorErrorHandler( Project project )
+    {
+        this.project = project;
+    }
+
+    public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
+    {
+        String msg = "Could not initialize repository system";
+        if ( !RepositorySystem.class.equals( type ) )
+        {
+            msg += ", service " + type.getName() + " (" + impl.getName() + ") failed to initialize";
+        }
+        msg += ": " + exception.getMessage();
+        project.log( msg, exception, Project.MSG_ERR );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntSettingsDecryptorFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntSettingsDecryptorFactory.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntSettingsDecryptorFactory.java
new file mode 100644
index 0000000..39ef960
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntSettingsDecryptorFactory.java
@@ -0,0 +1,51 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.lang.reflect.Field;
+
+import org.apache.maven.settings.crypto.DefaultSettingsDecrypter;
+
+/**
+ */
+class AntSettingsDecryptorFactory
+{
+
+    public DefaultSettingsDecrypter newInstance()
+    {
+        AntSecDispatcher secDispatcher = new AntSecDispatcher();
+
+        DefaultSettingsDecrypter decrypter = new DefaultSettingsDecrypter();
+
+        try
+        {
+            Field field = decrypter.getClass().getDeclaredField( "securityDispatcher" );
+            field.setAccessible( true );
+            field.set( decrypter, secDispatcher );
+        }
+        catch ( Exception e )
+        {
+            throw new IllegalStateException( e );
+        }
+
+        return decrypter;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntTransferListener.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntTransferListener.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntTransferListener.java
new file mode 100644
index 0000000..6844d22
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntTransferListener.java
@@ -0,0 +1,91 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.eclipse.aether.transfer.AbstractTransferListener;
+import org.eclipse.aether.transfer.TransferCancelledException;
+import org.eclipse.aether.transfer.TransferEvent;
+import org.eclipse.aether.transfer.TransferResource;
+
+/**
+ * Logs up- and downloads.
+ */
+class AntTransferListener
+    extends AbstractTransferListener
+{
+
+    private Task task;
+
+    public AntTransferListener( Task task )
+    {
+        this.task = task;
+    }
+
+    @Override
+    public void transferInitiated( TransferEvent event )
+        throws TransferCancelledException
+    {
+        String msg = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
+        msg += " " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName();
+        task.log( msg );
+    }
+
+    @Override
+    public void transferCorrupted( TransferEvent event )
+        throws TransferCancelledException
+    {
+        TransferResource resource = event.getResource();
+
+        task.log( event.getException().getMessage() + " for " + resource.getRepositoryUrl()
+                      + resource.getResourceName(), Project.MSG_WARN );
+    }
+
+    @Override
+    public void transferSucceeded( TransferEvent event )
+    {
+        String msg = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded";
+        msg += " " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName();
+
+        long contentLength = event.getTransferredBytes();
+        if ( contentLength >= 0 )
+        {
+            String len = contentLength >= 1024 ? ( ( contentLength + 1023 ) / 1024 ) + " KB" : contentLength + " B";
+
+            String throughput = "";
+            long duration = System.currentTimeMillis() - event.getResource().getTransferStartTime();
+            if ( duration > 0 )
+            {
+                DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
+                double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
+                throughput = " at " + format.format( kbPerSec ) + " KB/sec";
+            }
+
+            msg += " (" + len + throughput + ")";
+        }
+        task.log( msg );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/ConverterUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/ConverterUtils.java b/src/main/java/org/apache/maven/resolver/internal/ant/ConverterUtils.java
new file mode 100644
index 0000000..6452ec1
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/ConverterUtils.java
@@ -0,0 +1,227 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.resolver.internal.ant.types.Authentication;
+import org.apache.maven.resolver.internal.ant.types.Dependency;
+import org.apache.maven.resolver.internal.ant.types.Exclusion;
+import org.apache.maven.resolver.internal.ant.types.Proxy;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepositories;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepository;
+import org.apache.tools.ant.Project;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.ArtifactProperties;
+import org.eclipse.aether.artifact.ArtifactType;
+import org.eclipse.aether.artifact.ArtifactTypeRegistry;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.artifact.DefaultArtifactType;
+import org.eclipse.aether.impl.RemoteRepositoryManager;
+import org.eclipse.aether.repository.RepositoryPolicy;
+import org.eclipse.aether.util.repository.AuthenticationBuilder;
+
+/**
+ * Utility methods to convert between Aether and Ant objects.
+ */
+class ConverterUtils
+{
+
+    private static org.eclipse.aether.artifact.Artifact toArtifact( Dependency dependency, ArtifactTypeRegistry types )
+    {
+        ArtifactType type = types.get( dependency.getType() );
+        if ( type == null )
+        {
+            type = new DefaultArtifactType( dependency.getType() );
+        }
+
+        Map<String, String> props = null;
+        if ( "system".equals( dependency.getScope() ) && dependency.getSystemPath() != null )
+        {
+            props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, dependency.getSystemPath().getPath() );
+        }
+
+        Artifact artifact =
+            new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), null,
+                                 dependency.getVersion(), props, type );
+
+        return artifact;
+    }
+
+    public static org.eclipse.aether.repository.Authentication toAuthentication( Authentication auth )
+    {
+        if ( auth == null )
+        {
+            return null;
+        }
+        AuthenticationBuilder authBuilder = new AuthenticationBuilder();
+        authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() );
+        authBuilder.addPrivateKey( auth.getPrivateKeyFile(), auth.getPassphrase() );
+        return authBuilder.build();
+    }
+
+    public static org.eclipse.aether.graph.Dependency toDependency( Dependency dependency, List<Exclusion> exclusions,
+                                                                     RepositorySystemSession session )
+    {
+        return new org.eclipse.aether.graph.Dependency( toArtifact( dependency, session.getArtifactTypeRegistry() ),
+                                                         dependency.getScope(), false,
+                                                         toExclusions( dependency.getExclusions(), exclusions ) );
+    }
+
+    /**
+     * Converts the given ant repository type to an Aether repository instance with authentication and proxy filled in
+     * via the sessions' selectors.
+     */
+    public static org.eclipse.aether.repository.RemoteRepository toDistRepository( RemoteRepository repo,
+                                                                       RepositorySystemSession session )
+    {
+        org.eclipse.aether.repository.RemoteRepository result = toRepository( repo );
+        org.eclipse.aether.repository.RemoteRepository.Builder builder =
+            new org.eclipse.aether.repository.RemoteRepository.Builder( result );
+        builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( result ) );
+        builder.setProxy( session.getProxySelector().getProxy( result ) );
+        return builder.build();
+    }
+
+    private static org.eclipse.aether.graph.Exclusion toExclusion( Exclusion exclusion )
+    {
+        return new org.eclipse.aether.graph.Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(),
+                                                        exclusion.getClassifier(), exclusion.getExtension() );
+    }
+
+    private static Collection<org.eclipse.aether.graph.Exclusion> toExclusions( Collection<Exclusion> exclusions1,
+                                                                                 Collection<Exclusion> exclusions2 )
+    {
+        Collection<org.eclipse.aether.graph.Exclusion> results =
+            new LinkedHashSet<org.eclipse.aether.graph.Exclusion>();
+        if ( exclusions1 != null )
+        {
+            for ( Exclusion exclusion : exclusions1 )
+            {
+                results.add( toExclusion( exclusion ) );
+            }
+        }
+        if ( exclusions2 != null )
+        {
+            for ( Exclusion exclusion : exclusions2 )
+            {
+                results.add( toExclusion( exclusion ) );
+            }
+        }
+        return results;
+    }
+
+    private static RepositoryPolicy toPolicy( RemoteRepository.Policy policy, boolean enabled, String updates,
+                                              String checksums )
+    {
+        if ( policy != null )
+        {
+            enabled = policy.isEnabled();
+            if ( policy.getChecksums() != null )
+            {
+                checksums = policy.getChecksums();
+            }
+            if ( policy.getUpdates() != null )
+            {
+                updates = policy.getUpdates();
+            }
+        }
+        return new RepositoryPolicy( enabled, updates, checksums );
+    }
+
+    /**
+     * Adds every &lt;String, String>-entry in the map as a property to the given Properties.
+     */
+    public static Properties addProperties( Properties props, Map<?, ?> map )
+    {
+        if ( props == null )
+        {
+            props = new Properties();
+        }
+        for ( Map.Entry<?, ?> entry : map.entrySet() )
+        {
+            if ( entry.getKey() instanceof String && entry.getValue() instanceof String )
+            {
+                props.put( entry.getKey(), entry.getValue() );
+            }
+        }
+        return props;
+    }
+
+    public static org.eclipse.aether.repository.Proxy toProxy( Proxy proxy )
+    {
+        if ( proxy == null )
+        {
+            return null;
+        }
+        return new org.eclipse.aether.repository.Proxy( proxy.getType(), proxy.getHost(), proxy.getPort(),
+                                                         toAuthentication( proxy.getAuthentication() ) );
+    }
+
+    private static org.eclipse.aether.repository.RemoteRepository toRepository( RemoteRepository repo )
+    {
+        org.eclipse.aether.repository.RemoteRepository.Builder builder =
+            new org.eclipse.aether.repository.RemoteRepository.Builder( repo.getId(), repo.getType(), repo.getUrl() );
+        builder.setSnapshotPolicy( toPolicy( repo.getSnapshotPolicy(), repo.isSnapshots(), repo.getUpdates(),
+                                             repo.getChecksums() ) );
+        builder.setReleasePolicy( toPolicy( repo.getReleasePolicy(), repo.isReleases(), repo.getUpdates(),
+                                            repo.getChecksums() ) );
+        builder.setAuthentication( toAuthentication( repo.getAuthentication() ) );
+        return builder.build();
+    }
+
+    public static List<org.eclipse.aether.repository.RemoteRepository> toRepositories( Project project,
+                                                                          RepositorySystemSession session,
+                                                                          RemoteRepositories repos, RemoteRepositoryManager remoteRepositoryManager )
+    {
+        List<RemoteRepository> repositories;
+
+        if ( repos != null )
+        {
+            repositories = repos.getRepositories();
+        }
+        else
+        {
+            repositories = new ArrayList<RemoteRepository>();
+        }
+
+        List<org.eclipse.aether.repository.RemoteRepository> results =
+            new ArrayList<org.eclipse.aether.repository.RemoteRepository>();
+        for ( RemoteRepository repo : repositories )
+        {
+            results.add( toRepository( repo ) );
+        }
+
+        results =
+            remoteRepositoryManager.aggregateRepositories( session,
+                                                      Collections.<org.eclipse.aether.repository.RemoteRepository>emptyList(),
+                                                      results, true );
+
+        return results;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/Names.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/Names.java b/src/main/java/org/apache/maven/resolver/internal/ant/Names.java
new file mode 100644
index 0000000..3250376
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/Names.java
@@ -0,0 +1,44 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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.
+ */
+
+/**
+ */
+public final class Names
+{
+
+    private Names()
+    {
+        // hide constructor
+    }
+
+    public static final String ID = "aether";
+
+    public static final String ID_DEFAULT_REPOS = ID + ".repositories";
+
+    public static final String ID_DEFAULT_POM = ID + ".pom";
+
+    public static final String ID_CENTRAL = "central";
+
+    public static final String PROPERTY_OFFLINE = "aether.offline";
+
+    public static final String SETTINGS_XML = "settings.xml";
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReader.java b/src/main/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReader.java
new file mode 100644
index 0000000..8ae2857
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/ProjectWorkspaceReader.java
@@ -0,0 +1,144 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.repository.WorkspaceReader;
+import org.eclipse.aether.repository.WorkspaceRepository;
+import org.eclipse.aether.util.artifact.ArtifactIdUtils;
+
+/**
+ * Workspace reader caching available POMs and artifacts for ant builds.
+ * <p/>
+ * &lt;pom> elements are cached if they are defined by the 'file'-attribute, as they reference a backing pom.xml file that
+ * can be used for resolution with Aether. &lt;artifact> elements are cached if they directly define a 'pom'-attribute
+ * or child. The POM may be file-based or in-memory.
+ */
+public class ProjectWorkspaceReader
+    implements WorkspaceReader
+{
+
+    private static volatile ProjectWorkspaceReader instance;
+
+    private static final Object LOCK = new Object();
+
+    private Map<String, Artifact> artifacts = new ConcurrentHashMap<String, Artifact>();
+
+    public void addPom( Pom pom )
+    {
+        if ( pom.getFile() != null )
+        {
+            Model model = pom.getModel( pom );
+            Artifact aetherArtifact =
+                new DefaultArtifact( model.getGroupId(), model.getArtifactId(), null, "pom", model.getVersion() );
+            aetherArtifact = aetherArtifact.setFile( pom.getFile() );
+            String coords = coords( aetherArtifact );
+            artifacts.put( coords, aetherArtifact );
+        }
+    }
+
+    public void addArtifact( org.apache.maven.resolver.internal.ant.types.Artifact artifact )
+    {
+        if ( artifact.getPom() != null )
+        {
+            Pom pom = artifact.getPom();
+            Artifact aetherArtifact;
+            if ( pom.getFile() != null )
+            {
+                Model model = pom.getModel( pom );
+                aetherArtifact =
+                    new DefaultArtifact( model.getGroupId(), model.getArtifactId(), artifact.getClassifier(),
+                                         artifact.getType(), model.getVersion() );
+            }
+            else
+            {
+                aetherArtifact =
+                    new DefaultArtifact( pom.getGroupId(), pom.getArtifactId(), artifact.getClassifier(),
+                                         artifact.getType(), pom.getVersion() );
+            }
+            aetherArtifact = aetherArtifact.setFile( artifact.getFile() );
+
+            String coords = coords( aetherArtifact );
+            artifacts.put( coords, aetherArtifact );
+        }
+    }
+
+    private String coords( Artifact artifact )
+    {
+        return ArtifactIdUtils.toId( artifact );
+    }
+
+    public WorkspaceRepository getRepository()
+    {
+        return new WorkspaceRepository( "ant" );
+    }
+
+    public File findArtifact( Artifact artifact )
+    {
+        artifact = artifacts.get( coords( artifact ) );
+        return ( artifact != null ) ? artifact.getFile() : null;
+    }
+
+    public List<String> findVersions( Artifact artifact )
+    {
+        List<String> versions = new ArrayList<String>();
+        for ( Artifact art : artifacts.values() )
+        {
+            if ( ArtifactIdUtils.equalsVersionlessId( artifact, art ) )
+            {
+                versions.add( art.getVersion() );
+            }
+        }
+        return versions;
+    }
+
+    ProjectWorkspaceReader()
+    {
+    }
+
+    public static ProjectWorkspaceReader getInstance()
+    {
+        if ( instance == null )
+        {
+            synchronized ( LOCK )
+            {
+                if ( instance == null )
+                {
+                    instance = new ProjectWorkspaceReader();
+                }
+            }
+        }
+        return instance;
+    }
+
+    static void dropInstance()
+    {
+        instance = null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/SettingsUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/SettingsUtils.java b/src/main/java/org/apache/maven/resolver/internal/ant/SettingsUtils.java
new file mode 100644
index 0000000..51cb0d1
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/SettingsUtils.java
@@ -0,0 +1,182 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.settings.Activation;
+import org.apache.maven.settings.ActivationFile;
+import org.apache.maven.settings.ActivationOS;
+import org.apache.maven.settings.ActivationProperty;
+import org.apache.maven.settings.Profile;
+import org.apache.maven.settings.Repository;
+import org.apache.maven.settings.RepositoryPolicy;
+
+/**
+ * Utility methods to read settings from Mavens settings.xml.
+ */
+class SettingsUtils
+{
+
+    public static List<org.apache.maven.model.Profile> convert( List<Profile> profiles )
+    {
+        if ( profiles == null )
+        {
+            return null;
+        }
+
+        List<org.apache.maven.model.Profile> results = new ArrayList<org.apache.maven.model.Profile>();
+
+        for ( Profile profile : profiles )
+        {
+            results.add( convert( profile ) );
+        }
+
+        return results;
+    }
+
+    static org.apache.maven.model.Profile convert( Profile profile )
+    {
+        if ( profile == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.Profile result = new org.apache.maven.model.Profile();
+
+        result.setId( profile.getId() );
+        result.setProperties( profile.getProperties() );
+        result.setSource( "settings.xml" );
+        result.setActivation( convert( profile.getActivation() ) );
+
+        for ( Repository repo : profile.getRepositories() )
+        {
+            result.addRepository( convert( repo ) );
+        }
+
+        for ( Repository repo : profile.getPluginRepositories() )
+        {
+            result.addPluginRepository( convert( repo ) );
+        }
+
+        return result;
+    }
+
+    static org.apache.maven.model.Activation convert( Activation activation )
+    {
+        if ( activation == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.Activation result = new org.apache.maven.model.Activation();
+
+        result.setActiveByDefault( activation.isActiveByDefault() );
+        result.setJdk( activation.getJdk() );
+        result.setFile( convert( activation.getFile() ) );
+        result.setProperty( convert( activation.getProperty() ) );
+        result.setOs( convert( activation.getOs() ) );
+
+        return result;
+    }
+
+    static org.apache.maven.model.ActivationOS convert( ActivationOS activation )
+    {
+        if ( activation == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.ActivationOS result = new org.apache.maven.model.ActivationOS();
+
+        result.setArch( activation.getArch() );
+        result.setFamily( activation.getFamily() );
+        result.setName( activation.getName() );
+        result.setVersion( activation.getVersion() );
+
+        return result;
+    }
+
+    static org.apache.maven.model.ActivationProperty convert( ActivationProperty activation )
+    {
+        if ( activation == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.ActivationProperty result = new org.apache.maven.model.ActivationProperty();
+
+        result.setName( activation.getName() );
+        result.setValue( activation.getValue() );
+
+        return result;
+    }
+
+    static org.apache.maven.model.ActivationFile convert( ActivationFile activation )
+    {
+        if ( activation == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.ActivationFile result = new org.apache.maven.model.ActivationFile();
+
+        result.setExists( activation.getExists() );
+        result.setMissing( activation.getMissing() );
+
+        return result;
+    }
+
+    static org.apache.maven.model.Repository convert( Repository repo )
+    {
+        if ( repo == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.Repository result = new org.apache.maven.model.Repository();
+
+        result.setId( repo.getId() );
+        result.setUrl( repo.getUrl() );
+        result.setLayout( repo.getLayout() );
+        result.setReleases( convert( repo.getReleases() ) );
+        result.setSnapshots( convert( repo.getSnapshots() ) );
+
+        return result;
+    }
+
+    static org.apache.maven.model.RepositoryPolicy convert( RepositoryPolicy policy )
+    {
+        if ( policy == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.RepositoryPolicy result = new org.apache.maven.model.RepositoryPolicy();
+
+        result.setEnabled( policy.isEnabled() );
+        result.setChecksumPolicy( policy.getChecksumPolicy() );
+        result.setUpdatePolicy( policy.getUpdatePolicy() );
+
+        return result;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractDistTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractDistTask.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractDistTask.java
new file mode 100644
index 0000000..70bebbc
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractDistTask.java
@@ -0,0 +1,180 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.maven.resolver.internal.ant.types.Artifact;
+import org.apache.maven.resolver.internal.ant.types.Artifacts;
+import org.apache.maven.resolver.internal.ant.types.Pom;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public abstract class AbstractDistTask
+    extends Task
+{
+
+    private Pom pom;
+
+    private Artifacts artifacts;
+
+    protected void validate()
+    {
+        getArtifacts().validate( this );
+
+        Map<String, File> duplicates = new HashMap<String, File>();
+        for ( Artifact artifact : getArtifacts().getArtifacts() )
+        {
+            String key = artifact.getType() + ':' + artifact.getClassifier();
+            if ( "pom:".equals( key ) )
+            {
+                throw new BuildException( "You must not specify an <artifact> with type=pom"
+                    + ", please use the <pom> element instead." );
+            }
+            else if ( duplicates.containsKey( key ) )
+            {
+                throw new BuildException( "You must not specify two or more artifacts with the same type ("
+                    + artifact.getType() + ") and classifier (" + artifact.getClassifier() + ")" );
+            }
+            else
+            {
+                duplicates.put( key, artifact.getFile() );
+            }
+
+            validateArtifactGav( artifact );
+        }
+
+        Pom defaultPom = AntRepoSys.getInstance( getProject() ).getDefaultPom();
+        if ( pom == null && defaultPom != null )
+        {
+            log( "Using default POM (" + defaultPom.getCoords() + ")", Project.MSG_INFO );
+            pom = defaultPom;
+        }
+
+        if ( pom == null )
+        {
+            throw new BuildException( "You must specify the <pom file=\"...\"> element"
+                + " to denote the descriptor for the artifacts" );
+        }
+        if ( pom.getFile() == null )
+        {
+            throw new BuildException( "You must specify a <pom> element that has the 'file' attribute set" );
+        }
+    }
+
+    private void validateArtifactGav( Artifact artifact )
+    {
+        Pom artifactPom = artifact.getPom();
+        if ( artifactPom != null )
+        {
+            String gid;
+            String aid;
+            String version;
+            if ( artifactPom.getFile() != null )
+            {
+                Model model = artifactPom.getModel( this );
+                gid = model.getGroupId();
+                aid = model.getArtifactId();
+                version = model.getVersion();
+            }
+            else
+            {
+                gid = artifactPom.getGroupId();
+                aid = artifactPom.getArtifactId();
+                version = artifactPom.getVersion();
+            }
+            
+            Model model = getPom().getModel( this );
+            
+            if ( ! ( model.getGroupId().equals( gid ) && model.getArtifactId().equals( aid ) && model.getVersion().equals( version ) ) )
+            {
+                throw new BuildException( "Artifact references different pom than it would be installed with: "
+                    + artifact.toString() );
+            }
+        }
+    }
+
+    protected Artifacts getArtifacts()
+    {
+        if ( artifacts == null )
+        {
+            artifacts = new Artifacts();
+            artifacts.setProject( getProject() );
+        }
+        return artifacts;
+    }
+
+    public void addArtifact( Artifact artifact )
+    {
+        getArtifacts().addArtifact( artifact );
+    }
+
+    public void addArtifacts( Artifacts artifacts )
+    {
+        getArtifacts().addArtifacts( artifacts );
+    }
+
+    public void setArtifactsRef( Reference ref )
+    {
+        Artifacts artifacts = new Artifacts();
+        artifacts.setProject( getProject() );
+        artifacts.setRefid( ref );
+        getArtifacts().addArtifacts( artifacts );
+    }
+
+    protected Pom getPom()
+    {
+        if ( pom == null )
+        {
+            return AntRepoSys.getInstance( getProject() ).getDefaultPom();
+        }
+
+        return pom;
+    }
+
+    public void addPom( Pom pom )
+    {
+        if ( this.pom != null )
+        {
+            throw new BuildException( "You must not specify multiple <pom> elements" );
+        }
+        this.pom = pom;
+    }
+
+    public void setPomRef( Reference ref )
+    {
+        if ( this.pom != null )
+        {
+            throw new BuildException( "You must not specify multiple <pom> elements" );
+        }
+        pom = new Pom();
+        pom.setProject( getProject() );
+        pom.setRefid( ref );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractResolvingTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractResolvingTask.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractResolvingTask.java
new file mode 100644
index 0000000..c19e086
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/AbstractResolvingTask.java
@@ -0,0 +1,107 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.maven.resolver.internal.ant.types.Dependencies;
+import org.apache.maven.resolver.internal.ant.types.LocalRepository;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepositories;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepository;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Reference;
+import org.eclipse.aether.collection.CollectResult;
+
+/**
+ */
+public abstract class AbstractResolvingTask
+    extends Task
+{
+
+    protected Dependencies dependencies;
+
+    protected RemoteRepositories remoteRepositories;
+
+    protected LocalRepository localRepository;
+
+    public void addDependencies( Dependencies dependencies )
+    {
+        if ( this.dependencies != null )
+        {
+            throw new BuildException( "You must not specify multiple <dependencies> elements" );
+        }
+        this.dependencies = dependencies;
+    }
+
+    public void setDependenciesRef( Reference ref )
+    {
+        if ( dependencies == null )
+        {
+            dependencies = new Dependencies();
+            dependencies.setProject( getProject() );
+        }
+        dependencies.setRefid( ref );
+    }
+
+    public LocalRepository createLocalRepo()
+    {
+        if ( localRepository != null )
+        {
+            throw new BuildException( "You must not specify multiple <localRepo> elements" );
+        }
+        localRepository = new LocalRepository( this );
+        return localRepository;
+    }
+
+    private RemoteRepositories getRemoteRepos()
+    {
+        if ( remoteRepositories == null )
+        {
+            remoteRepositories = new RemoteRepositories();
+            remoteRepositories.setProject( getProject() );
+        }
+        return remoteRepositories;
+    }
+
+    public void addRemoteRepo( RemoteRepository repository )
+    {
+        getRemoteRepos().addRemoterepo( repository );
+    }
+
+    public void addRemoteRepos( RemoteRepositories repositories )
+    {
+        getRemoteRepos().addRemoterepos( repositories );
+    }
+
+    public void setRemoteReposRef( Reference ref )
+    {
+        RemoteRepositories repos = new RemoteRepositories();
+        repos.setProject( getProject() );
+        repos.setRefid( ref );
+        getRemoteRepos().addRemoterepos( repos );
+    }
+
+    protected CollectResult collectDependencies()
+    {
+        return AntRepoSys.getInstance( getProject() ).collectDependencies( this, dependencies, localRepository,
+                                                                           remoteRepositories );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/DependencyGraphLogger.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/DependencyGraphLogger.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/DependencyGraphLogger.java
new file mode 100644
index 0000000..c1fff1d
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/DependencyGraphLogger.java
@@ -0,0 +1,85 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
+
+/**
+ */
+class DependencyGraphLogger
+    implements DependencyVisitor
+{
+
+    private Task task;
+
+    private String indent = "";
+
+    public DependencyGraphLogger( Task task )
+    {
+        this.task = task;
+    }
+
+    public boolean visitEnter( DependencyNode node )
+    {
+        StringBuilder buffer = new StringBuilder( 128 );
+        buffer.append( indent );
+        Dependency dep = node.getDependency();
+        if ( dep != null )
+        {
+            Artifact art = dep.getArtifact();
+
+            buffer.append( art );
+            buffer.append( ':' ).append( dep.getScope() );
+
+            String premanagedScope = DependencyManagerUtils.getPremanagedScope( node );
+            if ( premanagedScope != null && !premanagedScope.equals( dep.getScope() ) )
+            {
+                buffer.append( " (scope managed from " ).append( premanagedScope ).append( ")" );
+            }
+
+            String premanagedVersion = DependencyManagerUtils.getPremanagedVersion( node );
+            if ( premanagedVersion != null && !premanagedVersion.equals( art.getVersion() ) )
+            {
+                buffer.append( " (version managed from " ).append( premanagedVersion ).append( ")" );
+            }
+        }
+        else
+        {
+            buffer.append( "Resolved Dependency Graph:" );
+        }
+
+        task.log( buffer.toString(), Project.MSG_VERBOSE );
+        indent += "   ";
+        return true;
+    }
+
+    public boolean visitLeave( DependencyNode node )
+    {
+        indent = indent.substring( 0, indent.length() - 3 );
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Deploy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Deploy.java b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Deploy.java
new file mode 100644
index 0000000..742dbc0
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/tasks/Deploy.java
@@ -0,0 +1,104 @@
+package org.apache.maven.resolver.internal.ant.tasks;
+
+/*
+ * 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 org.apache.maven.resolver.internal.ant.AntRepoSys;
+import org.apache.maven.resolver.internal.ant.types.RemoteRepository;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Reference;
+
+/**
+ */
+public class Deploy
+    extends AbstractDistTask
+{
+
+    private RemoteRepository repository;
+
+    private RemoteRepository snapshotRepository;
+
+    @Override
+    protected void validate()
+    {
+        super.validate();
+
+        if ( repository == null )
+        {
+            throw new BuildException( "You must specify the <remoteRepo id=\"...\" url=\"...\"> element"
+                + " to denote the target repository for the deployment" );
+        }
+        else
+        {
+            repository.validate( this );
+        }
+        if ( snapshotRepository != null )
+        {
+            snapshotRepository.validate( this );
+        }
+    }
+
+    public void addRemoteRepo( RemoteRepository repository )
+    {
+        if ( this.repository != null )
+        {
+            throw new BuildException( "You must not specify multiple <remoteRepo> elements" );
+        }
+        this.repository = repository;
+    }
+
+    public void setRemoteRepoRef( Reference ref )
+    {
+        if ( repository == null )
+        {
+            repository = new RemoteRepository();
+            repository.setProject( getProject() );
+        }
+        repository.setRefid( ref );
+    }
+
+    public void addSnapshotRepo( RemoteRepository snapshotRepository )
+    {
+        if ( this.snapshotRepository != null )
+        {
+            throw new BuildException( "You must not specify multiple <snapshotRepo> elements" );
+        }
+        this.snapshotRepository = snapshotRepository;
+    }
+
+    public void setSnapshotRepoRef( Reference ref )
+    {
+        if ( snapshotRepository == null )
+        {
+            snapshotRepository = new RemoteRepository();
+            snapshotRepository.setProject( getProject() );
+        }
+        snapshotRepository.setRefid( ref );
+    }
+
+    @Override
+    public void execute()
+        throws BuildException
+    {
+        validate();
+
+        AntRepoSys.getInstance( getProject() ).deploy( this, getPom(), getArtifacts(), repository, snapshotRepository );
+    }
+
+}


[5/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Dependency.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Dependency.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Dependency.java
deleted file mode 100644
index af93e86..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Dependency.java
+++ /dev/null
@@ -1,329 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Dependency
-    extends DataType
-    implements DependencyContainer
-{
-
-    private String groupId;
-
-    private String artifactId;
-
-    private String version;
-
-    private String classifier;
-
-    private String type;
-
-    private String scope;
-
-    private File systemPath;
-
-    private List<Exclusion> exclusions = new ArrayList<Exclusion>();
-
-    protected Dependency getRef()
-    {
-        return (Dependency) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            if ( groupId == null || groupId.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'groupId' for a dependency" );
-            }
-            if ( artifactId == null || artifactId.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'artifactId' for a dependency" );
-            }
-            if ( version == null || version.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'version' for a dependency" );
-            }
-
-            if ( "system".equals( scope ) )
-            {
-                if ( systemPath == null )
-                {
-                    throw new BuildException( "You must specify 'systemPath' for dependencies with scope=system" );
-                }
-            }
-            else if ( systemPath != null )
-            {
-                throw new BuildException( "You may only specify 'systemPath' for dependencies with scope=system" );
-            }
-
-            if ( scope != null && !"compile".equals( scope ) && !"provided".equals( scope ) && !"system".equals( scope )
-                && !"runtime".equals( scope ) && !"test".equals( scope ) )
-            {
-                task.log( "Unknown scope '" + scope + "' for dependency", Project.MSG_WARN );
-            }
-
-            for ( Exclusion exclusion : exclusions )
-            {
-                exclusion.validate( task );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( groupId != null || artifactId != null || type != null || classifier != null || version != null
-            || scope != null || systemPath != null )
-        {
-            throw tooManyAttributes();
-        }
-        if ( !exclusions.isEmpty() )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getGroupId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getGroupId();
-        }
-        return groupId;
-    }
-
-    public void setGroupId( String groupId )
-    {
-        checkAttributesAllowed();
-        if ( this.groupId != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.groupId = groupId;
-    }
-
-    public String getArtifactId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getArtifactId();
-        }
-        return artifactId;
-    }
-
-    public void setArtifactId( String artifactId )
-    {
-        checkAttributesAllowed();
-        if ( this.artifactId != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.artifactId = artifactId;
-    }
-
-    public String getVersion()
-    {
-        if ( isReference() )
-        {
-            return getRef().getVersion();
-        }
-        return version;
-    }
-
-    public void setVersion( String version )
-    {
-        checkAttributesAllowed();
-        if ( this.version != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.version = version;
-    }
-
-    public String getClassifier()
-    {
-        if ( isReference() )
-        {
-            return getRef().getClassifier();
-        }
-        return classifier;
-    }
-
-    public void setClassifier( String classifier )
-    {
-        checkAttributesAllowed();
-        if ( this.classifier != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.classifier = classifier;
-    }
-
-    public String getType()
-    {
-        if ( isReference() )
-        {
-            return getRef().getType();
-        }
-        return ( type != null ) ? type : "jar";
-    }
-
-    public void setType( String type )
-    {
-        checkAttributesAllowed();
-        if ( this.type != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.type = type;
-    }
-
-    public String getScope()
-    {
-        if ( isReference() )
-        {
-            return getRef().getScope();
-        }
-        return ( scope != null ) ? scope : "compile";
-    }
-
-    public void setScope( String scope )
-    {
-        checkAttributesAllowed();
-        if ( this.scope != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.scope = scope;
-    }
-
-    public void setCoords( String coords )
-    {
-        checkAttributesAllowed();
-        if ( groupId != null || artifactId != null || version != null || type != null || classifier != null
-            || scope != null )
-        {
-            throw ambiguousCoords();
-        }
-        Pattern p = Pattern.compile( "([^: ]+):([^: ]+):([^: ]+)((:([^: ]+)(:([^: ]+))?)?:([^: ]+))?" );
-        Matcher m = p.matcher( coords );
-        if ( !m.matches() )
-        {
-            throw new BuildException( "Bad dependency coordinates '" + coords
-                + "', expected format is <groupId>:<artifactId>:<version>[[:<type>[:<classifier>]]:<scope>]" );
-        }
-        groupId = m.group( 1 );
-        artifactId = m.group( 2 );
-        version = m.group( 3 );
-        type = m.group( 6 );
-        if ( type == null || type.length() <= 0 )
-        {
-            type = "jar";
-        }
-        classifier = m.group( 8 );
-        if ( classifier == null )
-        {
-            classifier = "";
-        }
-        scope = m.group( 9 );
-    }
-
-    public void setSystemPath( File systemPath )
-    {
-        checkAttributesAllowed();
-        this.systemPath = systemPath;
-    }
-
-    public File getSystemPath()
-    {
-        if ( isReference() )
-        {
-            return getRef().getSystemPath();
-        }
-        return systemPath;
-    }
-
-    public String getVersionlessKey()
-    {
-        if ( isReference() )
-        {
-            return getRef().getVersionlessKey();
-        }
-        StringBuilder key = new StringBuilder( 128 );
-        if ( groupId != null )
-        {
-            key.append( groupId );
-        }
-        key.append( ':' );
-        if ( artifactId != null )
-        {
-            key.append( artifactId );
-        }
-        key.append( ':' );
-        key.append( ( type != null ) ? type : "jar" );
-        if ( classifier != null && classifier.length() > 0 )
-        {
-            key.append( ':' );
-            key.append( classifier );
-        }
-        return key.toString();
-    }
-
-    public void addExclusion( Exclusion exclusion )
-    {
-        checkChildrenAllowed();
-        this.exclusions.add( exclusion );
-    }
-
-    public List<Exclusion> getExclusions()
-    {
-        if ( isReference() )
-        {
-            return getRef().getExclusions();
-        }
-        return exclusions;
-    }
-
-    private BuildException ambiguousCoords()
-    {
-        return new BuildException( "You must not specify both 'coords' and "
-            + "('groupId', 'artifactId', 'version', 'extension', 'classifier', 'scope')" );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/DependencyContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/DependencyContainer.java b/src/main/java/org/apache/maven/aether/internal/ant/types/DependencyContainer.java
deleted file mode 100644
index 6cdc92a..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/DependencyContainer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.tools.ant.Task;
-
-/**
- */
-public interface DependencyContainer
-{
-
-    void validate( Task task );
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Exclusion.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Exclusion.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Exclusion.java
deleted file mode 100644
index 9b99f80..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Exclusion.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Exclusion
-    extends DataType
-{
-
-    private static final String WILDCARD = "*";
-
-    private String groupId;
-
-    private String artifactId;
-
-    private String classifier;
-
-    private String extension;
-
-    protected Exclusion getRef()
-    {
-        return (Exclusion) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            if ( groupId == null && artifactId == null && classifier == null && extension == null )
-            {
-                throw new BuildException( "You must specify at least one of "
-                    + "'groupId', 'artifactId', 'classifier' or 'extension'" );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( groupId != null || artifactId != null || extension != null || classifier != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getGroupId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getGroupId();
-        }
-        return ( groupId != null ) ? groupId : WILDCARD;
-    }
-
-    public void setGroupId( String groupId )
-    {
-        checkAttributesAllowed();
-        if ( this.groupId != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.groupId = groupId;
-    }
-
-    public String getArtifactId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getArtifactId();
-        }
-        return ( artifactId != null ) ? artifactId : WILDCARD;
-    }
-
-    public void setArtifactId( String artifactId )
-    {
-        checkAttributesAllowed();
-        if ( this.artifactId != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.artifactId = artifactId;
-    }
-
-    public String getClassifier()
-    {
-        if ( isReference() )
-        {
-            return getRef().getClassifier();
-        }
-        return ( classifier != null ) ? classifier : WILDCARD;
-    }
-
-    public void setClassifier( String classifier )
-    {
-        checkAttributesAllowed();
-        if ( this.classifier != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.classifier = classifier;
-    }
-
-    public String getExtension()
-    {
-        if ( isReference() )
-        {
-            return getRef().getExtension();
-        }
-        return ( extension != null ) ? extension : WILDCARD;
-    }
-
-    public void setExtension( String extension )
-    {
-        checkAttributesAllowed();
-        if ( this.extension != null )
-        {
-            throw ambiguousCoords();
-        }
-        this.extension = extension;
-    }
-
-    public void setCoords( String coords )
-    {
-        checkAttributesAllowed();
-        if ( groupId != null || artifactId != null || extension != null || classifier != null )
-        {
-            throw ambiguousCoords();
-        }
-        Pattern p = Pattern.compile( "([^: ]+)(:([^: ]+)(:([^: ]+)(:([^: ]*))?)?)?" );
-        Matcher m = p.matcher( coords );
-        if ( !m.matches() )
-        {
-            throw new BuildException( "Bad exclusion coordinates '" + coords
-                + "', expected format is <groupId>[:<artifactId>[:<extension>[:<classifier>]]]" );
-        }
-        groupId = m.group( 1 );
-        artifactId = m.group( 3 );
-        if ( artifactId == null )
-        {
-            artifactId = "*";
-        }
-        extension = m.group( 5 );
-        if ( extension == null )
-        {
-            extension = "*";
-        }
-        classifier = m.group( 7 );
-        if ( classifier == null )
-        {
-            classifier = "*";
-        }
-    }
-
-    private BuildException ambiguousCoords()
-    {
-        return new BuildException( "You must not specify both 'coords' and "
-            + "('groupId', 'artifactId', 'extension', 'classifier')" );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/LocalRepository.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/LocalRepository.java b/src/main/java/org/apache/maven/aether/internal/ant/types/LocalRepository.java
deleted file mode 100644
index 9371aab..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/LocalRepository.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class LocalRepository
-    extends DataType
-{
-
-    private final Task task;
-
-    private File dir;
-
-    public LocalRepository()
-    {
-        this( null );
-    }
-
-    public LocalRepository( Task task )
-    {
-        this.task = task;
-    }
-
-    @Override
-    public void setProject( Project project )
-    {
-        super.setProject( project );
-
-        if ( task == null )
-        {
-            AntRepoSys.getInstance( project ).setLocalRepository( this );
-        }
-    }
-
-    protected LocalRepository getRef()
-    {
-        return (LocalRepository) getCheckedRef();
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( dir != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public File getDir()
-    {
-        if ( isReference() )
-        {
-            return getRef().getDir();
-        }
-        return dir;
-    }
-
-    public void setDir( File dir )
-    {
-        checkAttributesAllowed();
-        this.dir = dir;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Mirror.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Mirror.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Mirror.java
deleted file mode 100644
index bbb19bb..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Mirror.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.maven.aether.internal.ant.AntRepoSys;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Mirror
-    extends DataType
-{
-
-    private String id;
-
-    private String url;
-
-    private String type;
-
-    private String mirrorOf;
-
-    private Authentication authentication;
-
-    @Override
-    public void setProject( Project project )
-    {
-        super.setProject( project );
-
-        AntRepoSys.getInstance( project ).addMirror( this );
-    }
-
-    protected Mirror getRef()
-    {
-        return (Mirror) getCheckedRef();
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( id != null || url != null || mirrorOf != null || type != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getId();
-        }
-        return id;
-    }
-
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    public String getUrl()
-    {
-        if ( isReference() )
-        {
-            return getRef().getUrl();
-        }
-        return url;
-    }
-
-    public void setUrl( String url )
-    {
-        checkAttributesAllowed();
-        this.url = url;
-    }
-
-    public String getType()
-    {
-        if ( isReference() )
-        {
-            return getRef().getType();
-        }
-        return ( type != null ) ? type : "default";
-    }
-
-    public void setType( String type )
-    {
-        checkAttributesAllowed();
-        this.type = type;
-    }
-
-    public String getMirrorOf()
-    {
-        if ( isReference() )
-        {
-            return getRef().getMirrorOf();
-        }
-        return mirrorOf;
-    }
-
-    public void setMirrorOf( String mirrorOf )
-    {
-        checkAttributesAllowed();
-        this.mirrorOf = mirrorOf;
-    }
-
-    public void addAuthentication( Authentication authentication )
-    {
-        checkChildrenAllowed();
-        if ( this.authentication != null )
-        {
-            throw new BuildException( "You must not specify multiple <authentication> elements" );
-        }
-        this.authentication = authentication;
-    }
-
-    public Authentication getAuthentication()
-    {
-        if ( isReference() )
-        {
-            getRef().getAuthentication();
-        }
-        return authentication;
-    }
-
-    public void setAuthRef( Reference ref )
-    {
-        if ( authentication == null )
-        {
-            authentication = new Authentication();
-            authentication.setProject( getProject() );
-        }
-        authentication.setRefid( ref );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/ModelValueExtractor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/ModelValueExtractor.java b/src/main/java/org/apache/maven/aether/internal/ant/types/ModelValueExtractor.java
deleted file mode 100644
index 73fed22..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/ModelValueExtractor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.maven.model.Model;
-import org.apache.tools.ant.Project;
-import org.codehaus.plexus.interpolation.reflection.ReflectionValueExtractor;
-
-/**
- */
-class ModelValueExtractor
-{
-
-    private static final String PREFIX_PROPERTIES = "properties.";
-
-    private final String prefix;
-
-    private final Project project;
-
-    private final Model model;
-
-    public ModelValueExtractor( String prefix, Model model, Project project )
-    {
-        if ( model == null )
-        {
-            throw new IllegalArgumentException( "reference to Maven POM has not been specified" );
-        }
-        if ( project == null )
-        {
-            throw new IllegalArgumentException( "reference to Ant project has not been specified" );
-        }
-        if ( prefix == null || prefix.length() <= 0 )
-        {
-            prefix = "pom.";
-        }
-        else if ( !prefix.endsWith( "." ) )
-        {
-            prefix += '.';
-        }
-        this.prefix = prefix;
-        this.model = model;
-        this.project = project;
-    }
-
-    public Project getProject()
-    {
-        return project;
-    }
-
-    public boolean isApplicable( String expression )
-    {
-        return expression.startsWith( prefix );
-    }
-
-    public Object getValue( String expression )
-    {
-        if ( expression.startsWith( prefix ) )
-        {
-            String expr = expression.substring( prefix.length() );
-            try
-            {
-                if ( expr.startsWith( PREFIX_PROPERTIES ) )
-                {
-                    String key = expr.substring( PREFIX_PROPERTIES.length() );
-                    return model.getProperties().getProperty( key );
-                }
-
-                return ReflectionValueExtractor.evaluate( expr, model, false );
-            }
-            catch ( Exception e )
-            {
-                project.log( "Could not retrieve '" + expression + "' from POM: " + e.getMessage(), e, Project.MSG_WARN );
-                return null;
-            }
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Pom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Pom.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Pom.java
deleted file mode 100644
index eff8591..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Pom.java
+++ /dev/null
@@ -1,352 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.maven.aether.internal.ant.ProjectWorkspaceReader;
-import org.apache.maven.aether.internal.ant.tasks.RefTask;
-import org.apache.maven.model.Model;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.PropertyHelper;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Pom
-    extends RefTask
-{
-
-    private Model model;
-
-    private String id;
-
-    private File file;
-
-    private String groupId;
-
-    private String artifactId;
-
-    private String version;
-
-    private String packaging = "jar";
-
-    private RemoteRepositories remoteRepositories;
-
-    private String coords;
-
-    protected Pom getRef()
-    {
-        return (Pom) getCheckedRef();
-    }
-
-    public void validate()
-    {
-        if ( isReference() )
-        {
-            getRef().validate();
-        }
-        else
-        {
-            if ( file == null )
-            {
-                if ( groupId == null )
-                {
-                    throw new BuildException( "You must specify the 'groupId' for the POM" );
-                }
-                if ( artifactId == null )
-                {
-                    throw new BuildException( "You must specify the 'artifactId' for the POM" );
-                }
-                if ( version == null )
-                {
-                    throw new BuildException( "You must specify the 'version' for the POM" );
-                }
-            }
-        }
-
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( id != null || file != null || groupId != null || artifactId != null || version != null )
-        {
-            throw tooManyAttributes();
-        }
-        if ( remoteRepositories != null )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public void setId( String id )
-    {
-        checkAttributesAllowed();
-        this.id = id;
-    }
-
-    public File getFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getFile();
-        }
-        return file;
-    }
-
-    public void setFile( File file )
-    {
-        checkAttributesAllowed();
-        if ( groupId != null || artifactId != null || version != null )
-        {
-            throw ambiguousSource();
-        }
-
-        this.file = file;
-
-    }
-
-    public String getGroupId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getGroupId();
-        }
-        return groupId;
-    }
-
-    public void setGroupId( String groupId )
-    {
-        checkAttributesAllowed();
-        if ( this.groupId != null )
-        {
-            throw ambiguousCoords();
-        }
-        if ( file != null )
-        {
-            throw ambiguousSource();
-        }
-        this.groupId = groupId;
-    }
-
-    public String getArtifactId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getArtifactId();
-        }
-        return artifactId;
-    }
-
-    public void setArtifactId( String artifactId )
-    {
-        checkAttributesAllowed();
-        if ( this.artifactId != null )
-        {
-            throw ambiguousCoords();
-        }
-        if ( file != null )
-        {
-            throw ambiguousSource();
-        }
-        this.artifactId = artifactId;
-    }
-
-    public String getVersion()
-    {
-        if ( isReference() )
-        {
-            return getRef().getVersion();
-        }
-        return version;
-    }
-
-    public void setVersion( String version )
-    {
-        checkAttributesAllowed();
-        if ( this.version != null )
-        {
-            throw ambiguousCoords();
-        }
-        if ( file != null )
-        {
-            throw ambiguousSource();
-        }
-        this.version = version;
-    }
-
-    public String getCoords()
-    {
-        if ( isReference() )
-        {
-            return getRef().getCoords();
-        }
-        return coords;
-    }
-
-    public void setCoords( String coords )
-    {
-        checkAttributesAllowed();
-        if ( file != null )
-        {
-            throw ambiguousSource();
-        }
-        if ( groupId != null || artifactId != null || version != null )
-        {
-            throw ambiguousCoords();
-        }
-        Pattern p = Pattern.compile( "([^: ]+):([^: ]+):([^: ]+)" );
-        Matcher m = p.matcher( coords );
-        if ( !m.matches() )
-        {
-            throw new BuildException( "Bad POM coordinates, expected format is <groupId>:<artifactId>:<version>" );
-        }
-        groupId = m.group( 1 );
-        artifactId = m.group( 2 );
-        version = m.group( 3 );
-    }
-
-    private BuildException ambiguousCoords()
-    {
-        return new BuildException( "You must not specify both 'coords' and ('groupId', 'artifactId', 'version')" );
-    }
-
-    private BuildException ambiguousSource()
-    {
-        return new BuildException( "You must not specify both 'file' and "
-            + "('coords', 'groupId', 'artifactId', 'version')" );
-    }
-
-    public String getPackaging()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPackaging();
-        }
-        return packaging;
-    }
-
-    public void setPackaging( String packaging )
-    {
-        checkAttributesAllowed();
-        if ( file != null )
-        {
-            throw ambiguousSource();
-        }
-        this.packaging = packaging;
-    }
-
-    private RemoteRepositories getRemoteRepos()
-    {
-        if ( remoteRepositories == null )
-        {
-            remoteRepositories = new RemoteRepositories();
-            remoteRepositories.setProject( getProject() );
-        }
-        return remoteRepositories;
-    }
-
-    public void addRemoteRepo( RemoteRepository repository )
-    {
-        getRemoteRepos().addRemoterepo( repository );
-    }
-
-    public void addRemoteRepos( RemoteRepositories repositories )
-    {
-        getRemoteRepos().addRemoterepos( repositories );
-    }
-
-    public void setRemoteReposRef( Reference ref )
-    {
-        RemoteRepositories repos = new RemoteRepositories();
-        repos.setProject( getProject() );
-        repos.setRefid( ref );
-        getRemoteRepos().addRemoterepos( repos );
-    }
-
-    public Model getModel( Task task )
-    {
-        if ( isReference() )
-        {
-            return getRef().getModel( task );
-        }
-        synchronized ( this )
-        {
-            if ( model == null )
-            {
-                if ( file != null )
-                {
-                    model = AntRepoSys.getInstance( getProject() ).loadModel( task, file, true, remoteRepositories );
-                }
-            }
-            return model;
-        }
-    }
-
-    @Override
-    public void execute()
-    {
-        validate();
-
-        if ( file != null && ( id == null || AntRepoSys.getInstance( getProject() ).getDefaultPom() == null ) )
-        {
-            AntRepoSys.getInstance( getProject() ).setDefaultPom( this );
-        }
-
-        ProjectWorkspaceReader.getInstance().addPom( this );
-
-        Model model = getModel( this );
-
-        if ( model == null )
-        {
-            coords = getGroupId() + ":" + getArtifactId() + ":" + getVersion();
-            return;
-        }
-
-        coords = model.getGroupId() + ":" + model.getArtifactId() + ":" + model.getVersion();
-
-        ModelValueExtractor extractor = new ModelValueExtractor( id, model, getProject() );
-
-        PropertyHelper propHelper = PropertyHelper.getPropertyHelper( getProject() );
-
-        try
-        {
-            // Ant 1.8.0 delegate
-            PomPropertyEvaluator.register( extractor, propHelper );
-        }
-        catch ( LinkageError e )
-        {
-            // Ant 1.6 - 1.7.1 interceptor chaining
-            PomPropertyHelper.register( extractor, propHelper );
-        }
-
-    }
-
-    public String toString()
-    {
-        return coords + " (" + super.toString() + ")";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyEvaluator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyEvaluator.java b/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyEvaluator.java
deleted file mode 100644
index 1097e76..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyEvaluator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.tools.ant.PropertyHelper;
-import org.apache.tools.ant.PropertyHelper.PropertyEvaluator;
-import org.apache.tools.ant.property.NullReturn;
-
-/**
- */
-class PomPropertyEvaluator
-    implements PropertyEvaluator
-{
-
-    private final ModelValueExtractor extractor;
-
-    public static void register( ModelValueExtractor extractor, PropertyHelper propertyHelper )
-    {
-        propertyHelper.add( new PomPropertyEvaluator( extractor ) );
-    }
-
-    private PomPropertyEvaluator( ModelValueExtractor extractor )
-    {
-        if ( extractor == null )
-        {
-            throw new IllegalArgumentException( "no model value exractor specified" );
-        }
-        this.extractor = extractor;
-    }
-
-    public Object evaluate( String property, PropertyHelper propertyHelper )
-    {
-        Object value = extractor.getValue( property );
-        if ( value != null )
-        {
-            return value;
-        }
-        else if ( extractor.isApplicable( property ) )
-        {
-            return NullReturn.NULL;
-        }
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyHelper.java b/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyHelper.java
deleted file mode 100644
index 76af53b..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/PomPropertyHelper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.tools.ant.PropertyHelper;
-
-/**
- */
-@SuppressWarnings( "deprecation" )
-class PomPropertyHelper
-    extends PropertyHelper
-{
-
-    private final ModelValueExtractor extractor;
-
-    public static void register( ModelValueExtractor extractor, PropertyHelper propertyHelper )
-    {
-        PomPropertyHelper helper = new PomPropertyHelper( extractor );
-        helper.setNext( propertyHelper.getNext() );
-        propertyHelper.setNext( helper );
-    }
-
-    public PomPropertyHelper( ModelValueExtractor extractor )
-    {
-        if ( extractor == null )
-        {
-            throw new IllegalArgumentException( "no model value exractor specified" );
-        }
-        this.extractor = extractor;
-        setProject( extractor.getProject() );
-    }
-
-    @Override
-    public Object getPropertyHook( String ns, String name, boolean user )
-    {
-        Object value = extractor.getValue( name );
-        if ( value != null )
-        {
-            return value;
-        }
-        else if ( extractor.isApplicable( name ) )
-        {
-            return null;
-        }
-        return super.getPropertyHook( ns, name, user );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Proxy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Proxy.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Proxy.java
deleted file mode 100644
index 0ff671a..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Proxy.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 org.apache.maven.aether.internal.ant.AntRepoSys;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Proxy
-    extends DataType
-{
-
-    private String host;
-
-    private int port;
-
-    private String type;
-
-    private String nonProxyHosts;
-
-    private Authentication authentication;
-
-    @Override
-    public void setProject( Project project )
-    {
-        super.setProject( project );
-
-        AntRepoSys.getInstance( project ).addProxy( this );
-    }
-
-    protected Proxy getRef()
-    {
-        return (Proxy) getCheckedRef();
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( host != null || port != 0 || type != null || nonProxyHosts != null )
-        {
-            throw tooManyAttributes();
-        }
-        if ( authentication != null )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getHost()
-    {
-        if ( isReference() )
-        {
-            return getRef().getHost();
-        }
-        return host;
-    }
-
-    public void setHost( String host )
-    {
-        checkAttributesAllowed();
-        this.host = host;
-    }
-
-    public int getPort()
-    {
-        if ( isReference() )
-        {
-            return getRef().getPort();
-        }
-        return port;
-    }
-
-    public void setPort( int port )
-    {
-        checkAttributesAllowed();
-        if ( port <= 0 || port > 0xFFFF )
-        {
-            throw new BuildException( "The port number must be within the range 1 - 65535" );
-        }
-        this.port = port;
-    }
-
-    public String getType()
-    {
-        if ( isReference() )
-        {
-            return getRef().getType();
-        }
-        return type;
-    }
-
-    public void setType( String type )
-    {
-        checkAttributesAllowed();
-        this.type = type;
-    }
-
-    public String getNonProxyHosts()
-    {
-        if ( isReference() )
-        {
-            return getRef().getNonProxyHosts();
-        }
-        return nonProxyHosts;
-    }
-
-    public void setNonProxyHosts( String nonProxyHosts )
-    {
-        checkAttributesAllowed();
-        this.nonProxyHosts = nonProxyHosts;
-    }
-
-    public Authentication getAuthentication()
-    {
-        if ( isReference() )
-        {
-            return getRef().getAuthentication();
-        }
-        return authentication;
-    }
-
-    public void addAuthentication( Authentication authentication )
-    {
-        checkChildrenAllowed();
-        if ( this.authentication != null )
-        {
-            throw new BuildException( "You must not specify multiple <authentication> elements" );
-        }
-        this.authentication = authentication;
-    }
-
-    public void setAuthRef( Reference ref )
-    {
-        if ( authentication == null )
-        {
-            authentication = new Authentication();
-            authentication.setProject( getProject() );
-        }
-        authentication.setRefid( ref );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositories.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositories.java b/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositories.java
deleted file mode 100644
index 063a3b6..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositories.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class RemoteRepositories
-    extends DataType
-    implements RemoteRepositoryContainer
-{
-
-    private List<RemoteRepositoryContainer> containers = new ArrayList<RemoteRepositoryContainer>();
-
-    protected RemoteRepositories getRef()
-    {
-        return (RemoteRepositories) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            for ( RemoteRepositoryContainer container : containers )
-            {
-                container.validate( task );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( !containers.isEmpty() )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public void addRemoterepo( RemoteRepository repository )
-    {
-        checkChildrenAllowed();
-        containers.add( repository );
-    }
-
-    public void addRemoterepos( RemoteRepositories repositories )
-    {
-        checkChildrenAllowed();
-        if ( repositories == this )
-        {
-            throw circularReference();
-        }
-        containers.add( repositories );
-    }
-
-    public List<RemoteRepository> getRepositories()
-    {
-        if ( isReference() )
-        {
-            return getRef().getRepositories();
-        }
-        List<RemoteRepository> repos = new ArrayList<RemoteRepository>();
-        for ( RemoteRepositoryContainer container : containers )
-        {
-            repos.addAll( container.getRepositories() );
-        }
-        return repos;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepository.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepository.java b/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepository.java
deleted file mode 100644
index 4720004..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepository.java
+++ /dev/null
@@ -1,351 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.Collections;
-import java.util.List;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-import org.eclipse.aether.repository.RepositoryPolicy;
-
-/**
- */
-public class RemoteRepository
-    extends DataType
-    implements RemoteRepositoryContainer
-{
-
-    private String id;
-
-    private String url;
-
-    private String type;
-
-    private Policy releasePolicy;
-
-    private Policy snapshotPolicy;
-
-    private boolean releases = true;
-
-    private boolean snapshots = false;
-
-    private String checksums;
-
-    private String updates;
-
-    private Authentication authentication;
-
-    @Override
-    public void setProject( Project project )
-    {
-        super.setProject( project );
-
-        // NOTE: Just trigger side-effect of default initialization before this type potentially overrides central
-        AntRepoSys.getInstance( project );
-    }
-
-    protected RemoteRepository getRef()
-    {
-        return (RemoteRepository) getCheckedRef();
-    }
-
-    public void validate( Task task )
-    {
-        if ( isReference() )
-        {
-            getRef().validate( task );
-        }
-        else
-        {
-            if ( url == null || url.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'url' for a remote repository" );
-            }
-            if ( id == null || id.length() <= 0 )
-            {
-                throw new BuildException( "You must specify the 'id' for a remote repository" );
-            }
-        }
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( id != null || url != null || type != null || checksums != null || updates != null )
-        {
-            throw tooManyAttributes();
-        }
-        if ( releasePolicy != null || snapshotPolicy != null || authentication != null )
-        {
-            throw noChildrenAllowed();
-        }
-        super.setRefid( ref );
-    }
-
-    public String getId()
-    {
-        if ( isReference() )
-        {
-            return getRef().getId();
-        }
-        return id;
-    }
-
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    public String getUrl()
-    {
-        if ( isReference() )
-        {
-            return getRef().getUrl();
-        }
-        return url;
-    }
-
-    public void setUrl( String url )
-    {
-        checkAttributesAllowed();
-        this.url = url;
-    }
-
-    public String getType()
-    {
-        if ( isReference() )
-        {
-            return getRef().getType();
-        }
-        return ( type != null ) ? type : "default";
-    }
-
-    public void setType( String type )
-    {
-        checkAttributesAllowed();
-        this.type = type;
-    }
-
-    public Policy getReleasePolicy()
-    {
-        if ( isReference() )
-        {
-            return getRef().getReleasePolicy();
-        }
-        return releasePolicy;
-    }
-
-    public void addReleases( Policy policy )
-    {
-        checkChildrenAllowed();
-        if ( this.releasePolicy != null )
-        {
-            throw new BuildException( "You must not specify multiple <releases> elements" );
-        }
-        this.releasePolicy = policy;
-    }
-
-    public Policy getSnapshotPolicy()
-    {
-        if ( isReference() )
-        {
-            return getRef().getSnapshotPolicy();
-        }
-        return snapshotPolicy;
-    }
-
-    public void addSnapshots( Policy policy )
-    {
-        checkChildrenAllowed();
-        if ( this.snapshotPolicy != null )
-        {
-            throw new BuildException( "You must not specify multiple <snapshots> elements" );
-        }
-        this.snapshotPolicy = policy;
-    }
-
-    public boolean isReleases()
-    {
-        if ( isReference() )
-        {
-            return getRef().isReleases();
-        }
-        return releases;
-    }
-
-    public void setReleases( boolean releases )
-    {
-        checkAttributesAllowed();
-        this.releases = releases;
-    }
-
-    public boolean isSnapshots()
-    {
-        if ( isReference() )
-        {
-            return getRef().isSnapshots();
-        }
-        return snapshots;
-    }
-
-    public void setSnapshots( boolean snapshots )
-    {
-        checkAttributesAllowed();
-        this.snapshots = snapshots;
-    }
-
-    public String getUpdates()
-    {
-        if ( isReference() )
-        {
-            return getRef().getUpdates();
-        }
-        return ( updates != null ) ? updates : RepositoryPolicy.UPDATE_POLICY_DAILY;
-    }
-
-    public void setUpdates( String updates )
-    {
-        checkAttributesAllowed();
-        checkUpdates( updates );
-        this.updates = updates;
-    }
-
-    protected static void checkUpdates( String updates )
-    {
-        if ( !RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( updates )
-            && !RepositoryPolicy.UPDATE_POLICY_DAILY.equals( updates )
-            && !RepositoryPolicy.UPDATE_POLICY_NEVER.equals( updates )
-            && !updates.startsWith( RepositoryPolicy.UPDATE_POLICY_INTERVAL ) )
-        {
-            throw new BuildException( "'" + updates + "' is not a permitted update policy" );
-        }
-    }
-
-    public String getChecksums()
-    {
-        if ( isReference() )
-        {
-            return getRef().getChecksums();
-        }
-        return ( checksums != null ) ? checksums : RepositoryPolicy.CHECKSUM_POLICY_WARN;
-    }
-
-    public void setChecksums( String checksums )
-    {
-        checkAttributesAllowed();
-        checkChecksums( checksums );
-        this.checksums = checksums;
-    }
-
-    protected static void checkChecksums( String checksums )
-    {
-        if ( !RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( checksums )
-            && !RepositoryPolicy.CHECKSUM_POLICY_WARN.equals( checksums )
-            && !RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( checksums ) )
-        {
-            throw new BuildException( "'" + checksums + "' is not a permitted checksum policy" );
-        }
-    }
-
-    public Authentication getAuthentication()
-    {
-        if ( isReference() )
-        {
-            return getRef().getAuthentication();
-        }
-        return authentication;
-    }
-
-    public void addAuthentication( Authentication authentication )
-    {
-        checkChildrenAllowed();
-        if ( this.authentication != null )
-        {
-            throw new BuildException( "You must not specify multiple <authentication> elements" );
-        }
-        this.authentication = authentication;
-    }
-
-    public void setAuthRef( Reference ref )
-    {
-        checkAttributesAllowed();
-        if ( authentication == null )
-        {
-            authentication = new Authentication();
-            authentication.setProject( getProject() );
-        }
-        authentication.setRefid( ref );
-    }
-
-    public List<RemoteRepository> getRepositories()
-    {
-        return Collections.singletonList( this );
-    }
-
-    /**
-     */
-    public static class Policy
-    {
-
-        private boolean enabled = true;
-
-        private String checksumPolicy;
-
-        private String updatePolicy;
-
-        public boolean isEnabled()
-        {
-            return enabled;
-        }
-
-        public void setEnabled( boolean enabled )
-        {
-            this.enabled = enabled;
-        }
-
-        public String getChecksums()
-        {
-            return checksumPolicy;
-        }
-
-        public void setChecksums( String checksumPolicy )
-        {
-            checkChecksums( checksumPolicy );
-            this.checksumPolicy = checksumPolicy;
-        }
-
-        public String getUpdates()
-        {
-            return updatePolicy;
-        }
-
-        public void setUpdates( String updatePolicy )
-        {
-            checkUpdates( updatePolicy );
-            this.updatePolicy = updatePolicy;
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositoryContainer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositoryContainer.java b/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositoryContainer.java
deleted file mode 100644
index 488ffb6..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/RemoteRepositoryContainer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.util.List;
-
-import org.apache.tools.ant.Task;
-
-/**
- */
-public interface RemoteRepositoryContainer
-{
-
-    void validate( Task task );
-
-    List<RemoteRepository> getRepositories();
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/types/Settings.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/types/Settings.java b/src/main/java/org/apache/maven/aether/internal/ant/types/Settings.java
deleted file mode 100644
index 85190b1..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/types/Settings.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.maven.aether.internal.ant.types;
-
-/*
- * 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 java.io.File;
-
-import org.apache.maven.aether.internal.ant.AntRepoSys;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- */
-public class Settings
-    extends DataType
-{
-
-    private File file;
-
-    private File globalFile;
-
-    protected Settings getRef()
-    {
-        return (Settings) getCheckedRef();
-    }
-
-    public void setRefid( Reference ref )
-    {
-        if ( file != null || globalFile != null )
-        {
-            throw tooManyAttributes();
-        }
-        super.setRefid( ref );
-    }
-
-    public File getFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getFile();
-        }
-        return file;
-    }
-
-    public void setFile( File file )
-    {
-        checkAttributesAllowed();
-        this.file = file;
-
-        AntRepoSys.getInstance( getProject() ).setUserSettings( file );
-    }
-
-    public File getGlobalFile()
-    {
-        if ( isReference() )
-        {
-            return getRef().getFile();
-        }
-        return globalFile;
-    }
-
-    public void setGlobalFile( File globalFile )
-    {
-        checkAttributesAllowed();
-        this.globalFile = globalFile;
-
-        AntRepoSys.getInstance( getProject() ).setGlobalSettings( globalFile );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AetherUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AetherUtils.java b/src/main/java/org/apache/maven/resolver/internal/ant/AetherUtils.java
new file mode 100644
index 0000000..6b59f90
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AetherUtils.java
@@ -0,0 +1,83 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.maven.resolver.internal.ant.types.RemoteRepositories;
+import org.apache.tools.ant.Project;
+
+class AetherUtils
+{
+
+    public static File findGlobalSettings( Project project )
+    {
+        File file = new File( new File( project.getProperty( "ant.home" ), "etc" ), Names.SETTINGS_XML );
+        if ( file.isFile() )
+        {
+            return file;
+        }
+        else
+        {
+            String mavenHome = getMavenHome( project );
+            if ( mavenHome != null )
+            {
+                return new File( new File( mavenHome, "conf" ), Names.SETTINGS_XML );
+            }
+        }
+    
+        return null;
+    }
+
+    public static String getMavenHome( Project project )
+    {
+        String mavenHome = project.getProperty( "maven.home" );
+        if ( mavenHome != null )
+        {
+            return mavenHome;
+        }
+        return System.getenv( "M2_HOME" );
+    }
+
+    public static File findUserSettings( Project project )
+    {
+        File userHome = new File( project.getProperty( "user.home" ) );
+        File file = new File( new File( userHome, ".ant" ), Names.SETTINGS_XML );
+        if ( file.isFile() )
+        {
+            return file;
+        }
+        else
+        {
+            return new File( new File( userHome, ".m2" ), Names.SETTINGS_XML );
+        }
+    }
+
+    public static RemoteRepositories getDefaultRepositories( Project project )
+    {
+        Object obj = project.getReference( Names.ID_DEFAULT_REPOS );
+        if ( obj instanceof RemoteRepositories )
+        {
+            return (RemoteRepositories) obj;
+        }
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntLogger.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntLogger.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntLogger.java
new file mode 100644
index 0000000..711d653
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntLogger.java
@@ -0,0 +1,68 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 org.apache.tools.ant.Project;
+import org.eclipse.aether.spi.log.Logger;
+
+/**
+ */
+class AntLogger
+    implements Logger
+{
+
+    private Project project;
+
+    public AntLogger( Project project )
+    {
+        this.project = project;
+    }
+
+    public void debug( String msg )
+    {
+        project.log( msg, Project.MSG_DEBUG );
+    }
+
+    public void debug( String msg, Throwable error )
+    {
+        project.log( msg, error, Project.MSG_DEBUG );
+    }
+
+    public boolean isDebugEnabled()
+    {
+        return true;
+    }
+
+    public boolean isWarnEnabled()
+    {
+        return true;
+    }
+
+    public void warn( String msg )
+    {
+        project.log( msg, Project.MSG_WARN );
+    }
+
+    public void warn( String msg, Throwable error )
+    {
+        project.log( msg, error, Project.MSG_WARN );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/resolver/internal/ant/AntModelResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/resolver/internal/ant/AntModelResolver.java b/src/main/java/org/apache/maven/resolver/internal/ant/AntModelResolver.java
new file mode 100644
index 0000000..83311fb
--- /dev/null
+++ b/src/main/java/org/apache/maven/resolver/internal/ant/AntModelResolver.java
@@ -0,0 +1,157 @@
+package org.apache.maven.resolver.internal.ant;
+
+/*
+ * 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 java.io.File;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.model.Repository;
+import org.apache.maven.model.building.FileModelSource;
+import org.apache.maven.model.building.ModelSource;
+import org.apache.maven.model.resolution.InvalidRepositoryException;
+import org.apache.maven.model.resolution.ModelResolver;
+import org.apache.maven.model.resolution.UnresolvableModelException;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.impl.RemoteRepositoryManager;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.repository.RepositoryPolicy;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+
+/**
+ * A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
+ * been initially specified and repositories discovered in dependency POMs are recessively merged into the search chain.
+ * 
+ */
+class AntModelResolver
+    implements ModelResolver
+{
+
+    private final RepositorySystemSession session;
+
+    private final String context;
+
+    private List<org.eclipse.aether.repository.RemoteRepository> repositories;
+
+    private final RepositorySystem repoSys;
+
+    private final RemoteRepositoryManager remoteRepositoryManager;
+
+    private final Set<String> repositoryIds;
+
+    public AntModelResolver( RepositorySystemSession session, String context, RepositorySystem repoSys,
+                             RemoteRepositoryManager remoteRepositoryManager, List<RemoteRepository> repositories )
+    {
+        this.session = session;
+        this.context = context;
+        this.repoSys = repoSys;
+        this.remoteRepositoryManager = remoteRepositoryManager;
+        this.repositories = repositories;
+        this.repositoryIds = new HashSet<String>();
+    }
+
+    private AntModelResolver( AntModelResolver original )
+    {
+        this.session = original.session;
+        this.context = original.context;
+        this.repoSys = original.repoSys;
+        this.remoteRepositoryManager = original.remoteRepositoryManager;
+        this.repositories = original.repositories;
+        this.repositoryIds = new HashSet<String>( original.repositoryIds );
+    }
+
+    public void addRepository( Repository repository )
+        throws InvalidRepositoryException
+    {
+        if ( !repositoryIds.add( repository.getId() ) )
+        {
+            return;
+        }
+
+        List<RemoteRepository> newRepositories = Collections.singletonList( convert( repository ) );
+
+        this.repositories =
+            remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true );
+    }
+
+    static RemoteRepository convert( Repository repository )
+    {
+        RemoteRepository.Builder builder =
+            new RemoteRepository.Builder( repository.getId(), repository.getLayout(), repository.getUrl() );
+        builder.setSnapshotPolicy( convert( repository.getSnapshots() ) );
+        builder.setReleasePolicy( convert( repository.getReleases() ) );
+        return builder.build();
+    }
+
+    private static RepositoryPolicy convert( org.apache.maven.model.RepositoryPolicy policy )
+    {
+        boolean enabled = true;
+        String checksums = RepositoryPolicy.CHECKSUM_POLICY_WARN;
+        String updates = RepositoryPolicy.UPDATE_POLICY_DAILY;
+
+        if ( policy != null )
+        {
+            enabled = policy.isEnabled();
+            if ( policy.getUpdatePolicy() != null )
+            {
+                updates = policy.getUpdatePolicy();
+            }
+            if ( policy.getChecksumPolicy() != null )
+            {
+                checksums = policy.getChecksumPolicy();
+            }
+        }
+
+        return new RepositoryPolicy( enabled, updates, checksums );
+    }
+
+    public ModelResolver newCopy()
+    {
+        return new AntModelResolver( this );
+    }
+
+    public ModelSource resolveModel( String groupId, String artifactId, String version )
+        throws UnresolvableModelException
+    {
+        Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
+
+        try
+        {
+            ArtifactRequest request = new ArtifactRequest( pomArtifact, repositories, context );
+            pomArtifact = repoSys.resolveArtifact( session, request ).getArtifact();
+        }
+        catch ( ArtifactResolutionException e )
+        {
+            throw new UnresolvableModelException( "Failed to resolve POM for " + groupId + ":" + artifactId + ":"
+                + version + " due to " + e.getMessage(), groupId, artifactId, version, e );
+        }
+
+        File pomFile = pomArtifact.getFile();
+
+        return new FileModelSource( pomFile );
+    }
+
+}


[7/7] maven-resolver git commit: MNG-6007 renamed package to Maven Artifact Resolver

Posted by hb...@apache.org.
MNG-6007 renamed package to Maven Artifact Resolver

Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/b5f1ab9c
Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/b5f1ab9c
Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/b5f1ab9c

Branch: refs/heads/ant-tasks
Commit: b5f1ab9c461199aed746d5d853408631cae2b1e1
Parents: 1e6e278
Author: Herv� Boutemy <hb...@apache.org>
Authored: Thu Sep 15 23:10:44 2016 +0200
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Thu Sep 15 23:10:44 2016 +0200

----------------------------------------------------------------------
 README.md                                       |  18 +-
 build.xml                                       |  52 +-
 pom.xml                                         |  36 +-
 .../maven/aether/internal/ant/AetherUtils.java  |  83 --
 .../maven/aether/internal/ant/AntLogger.java    |  68 --
 .../aether/internal/ant/AntModelResolver.java   | 157 ----
 .../maven/aether/internal/ant/AntRepoSys.java   | 825 -------------------
 .../internal/ant/AntRepositoryListener.java     | 123 ---
 .../aether/internal/ant/AntSecDispatcher.java   |  45 -
 .../ant/AntServiceLocatorErrorHandler.java      |  50 --
 .../ant/AntSettingsDecryptorFactory.java        |  51 --
 .../internal/ant/AntTransferListener.java       |  91 --
 .../aether/internal/ant/ConverterUtils.java     | 227 -----
 .../apache/maven/aether/internal/ant/Names.java |  44 -
 .../internal/ant/ProjectWorkspaceReader.java    | 144 ----
 .../aether/internal/ant/SettingsUtils.java      | 182 ----
 .../internal/ant/tasks/AbstractDistTask.java    | 180 ----
 .../ant/tasks/AbstractResolvingTask.java        | 108 ---
 .../ant/tasks/DependencyGraphLogger.java        |  85 --
 .../maven/aether/internal/ant/tasks/Deploy.java | 105 ---
 .../aether/internal/ant/tasks/Install.java      |  60 --
 .../maven/aether/internal/ant/tasks/Layout.java | 131 ---
 .../aether/internal/ant/tasks/RefTask.java      |  98 ---
 .../aether/internal/ant/tasks/Resolve.java      | 585 -------------
 .../aether/internal/ant/types/Artifact.java     | 181 ----
 .../internal/ant/types/ArtifactContainer.java   |  35 -
 .../aether/internal/ant/types/Artifacts.java    |  97 ---
 .../internal/ant/types/Authentication.java      | 152 ----
 .../aether/internal/ant/types/Dependencies.java | 197 -----
 .../aether/internal/ant/types/Dependency.java   | 329 --------
 .../internal/ant/types/DependencyContainer.java |  31 -
 .../aether/internal/ant/types/Exclusion.java    | 190 -----
 .../internal/ant/types/LocalRepository.java     |  90 --
 .../maven/aether/internal/ant/types/Mirror.java | 155 ----
 .../internal/ant/types/ModelValueExtractor.java |  99 ---
 .../maven/aether/internal/ant/types/Pom.java    | 352 --------
 .../ant/types/PomPropertyEvaluator.java         |  62 --
 .../internal/ant/types/PomPropertyHelper.java   |  65 --
 .../maven/aether/internal/ant/types/Proxy.java  | 164 ----
 .../internal/ant/types/RemoteRepositories.java  |  97 ---
 .../internal/ant/types/RemoteRepository.java    | 351 --------
 .../ant/types/RemoteRepositoryContainer.java    |  35 -
 .../aether/internal/ant/types/Settings.java     |  86 --
 .../resolver/internal/ant/AetherUtils.java      |  83 ++
 .../maven/resolver/internal/ant/AntLogger.java  |  68 ++
 .../resolver/internal/ant/AntModelResolver.java | 157 ++++
 .../maven/resolver/internal/ant/AntRepoSys.java | 825 +++++++++++++++++++
 .../internal/ant/AntRepositoryListener.java     | 123 +++
 .../resolver/internal/ant/AntSecDispatcher.java |  45 +
 .../ant/AntServiceLocatorErrorHandler.java      |  50 ++
 .../ant/AntSettingsDecryptorFactory.java        |  51 ++
 .../internal/ant/AntTransferListener.java       |  91 ++
 .../resolver/internal/ant/ConverterUtils.java   | 227 +++++
 .../maven/resolver/internal/ant/Names.java      |  44 +
 .../internal/ant/ProjectWorkspaceReader.java    | 144 ++++
 .../resolver/internal/ant/SettingsUtils.java    | 182 ++++
 .../internal/ant/tasks/AbstractDistTask.java    | 180 ++++
 .../ant/tasks/AbstractResolvingTask.java        | 107 +++
 .../ant/tasks/DependencyGraphLogger.java        |  85 ++
 .../resolver/internal/ant/tasks/Deploy.java     | 104 +++
 .../resolver/internal/ant/tasks/Install.java    |  41 +
 .../resolver/internal/ant/tasks/Layout.java     | 131 +++
 .../resolver/internal/ant/tasks/RefTask.java    |  98 +++
 .../resolver/internal/ant/tasks/Resolve.java    | 585 +++++++++++++
 .../resolver/internal/ant/types/Artifact.java   | 181 ++++
 .../internal/ant/types/ArtifactContainer.java   |  35 +
 .../resolver/internal/ant/types/Artifacts.java  |  97 +++
 .../internal/ant/types/Authentication.java      | 152 ++++
 .../internal/ant/types/Dependencies.java        | 197 +++++
 .../resolver/internal/ant/types/Dependency.java | 329 ++++++++
 .../internal/ant/types/DependencyContainer.java |  31 +
 .../resolver/internal/ant/types/Exclusion.java  | 190 +++++
 .../internal/ant/types/LocalRepository.java     |  90 ++
 .../resolver/internal/ant/types/Mirror.java     | 154 ++++
 .../internal/ant/types/ModelValueExtractor.java |  99 +++
 .../maven/resolver/internal/ant/types/Pom.java  | 352 ++++++++
 .../ant/types/PomPropertyEvaluator.java         |  62 ++
 .../internal/ant/types/PomPropertyHelper.java   |  65 ++
 .../resolver/internal/ant/types/Proxy.java      | 163 ++++
 .../internal/ant/types/RemoteRepositories.java  |  97 +++
 .../internal/ant/types/RemoteRepository.java    | 351 ++++++++
 .../ant/types/RemoteRepositoryContainer.java    |  35 +
 .../resolver/internal/ant/types/Settings.java   |  86 ++
 .../org/apache/maven/aether/ant/antlib.xml      |  41 -
 .../org/apache/maven/resolver/ant/antlib.xml    |  41 +
 .../aether/internal/ant/AntBuildsTest.java      | 123 ---
 .../maven/aether/internal/ant/DeployTest.java   |  91 --
 .../maven/aether/internal/ant/InstallTest.java  |  98 ---
 .../ant/ProjectWorkspaceReaderTest.java         | 123 ---
 .../maven/aether/internal/ant/ReactorTest.java  |  99 ---
 .../maven/aether/internal/ant/ResolveTest.java  | 150 ----
 .../maven/aether/internal/ant/SettingsTest.java |  63 --
 .../aether/internal/ant/tasks/LayoutTest.java   |  54 --
 .../internal/ant/types/DependencyTest.java      |  87 --
 .../internal/ant/types/ExclusionTest.java       |  87 --
 .../aether/internal/ant/types/PomTest.java      |  42 -
 .../resolver/internal/ant/AntBuildsTest.java    | 124 +++
 .../maven/resolver/internal/ant/DeployTest.java |  91 ++
 .../resolver/internal/ant/InstallTest.java      |  98 +++
 .../ant/ProjectWorkspaceReaderTest.java         | 124 +++
 .../resolver/internal/ant/ReactorTest.java      | 100 +++
 .../resolver/internal/ant/ResolveTest.java      | 150 ++++
 .../resolver/internal/ant/SettingsTest.java     |  65 ++
 .../resolver/internal/ant/tasks/LayoutTest.java |  55 ++
 .../internal/ant/types/DependencyTest.java      |  88 ++
 .../internal/ant/types/ExclusionTest.java       |  88 ++
 .../resolver/internal/ant/types/PomTest.java    |  43 +
 src/test/resources/ant/Deploy/ant.xml           |   2 +-
 src/test/resources/ant/Install/ant.xml          |   2 +-
 src/test/resources/ant/Reactor/ant.xml          |   2 +-
 src/test/resources/ant/Resolve/ant.xml          |   2 +-
 src/test/resources/ant/Settings/ant.xml         |   2 +-
 src/test/resources/ant/common.xml               |   2 +-
 113 files changed, 7313 insertions(+), 7327 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 83abe3a..5d09410 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,17 @@
-# Aether Ant Tasks
+# Maven Artifact Resolver Ant Tasks
 
-The Aether Ant Tasks enable build scripts for [Apache Ant](http://ant.apache.org/) 1.7+ to use 
-[Maven Aether](/aether/) combined to
+The Maven Artifact Resolver Ant Tasks enable build scripts for [Apache Ant](http://ant.apache.org/) 1.7+ to use 
+[Maven Artifact Resolver](/resolver/) combined to
 [Apache Maven Aether Provider](/ref/current/maven-aether-provider/) to resolve dependencies
 and install and deploy locally built artifacts.
 
 To integrate the tasks into your build file, copy the JAR into your project's lib directory and use the following
 snippet to load it:
 
-    <project xmlns:aether="antlib:org.apache.maven.aether.ant" ...>
-      <taskdef uri="antlib:org.apache.maven.aether.ant" resource="org/apache/maven/aether/ant/antlib.xml">
+    <project xmlns:aether="antlib:org.apache.maven.resolver.ant" ...>
+      <taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
         <classpath>
-          <fileset dir="lib" includes="aether-ant-tasks-*.jar"/>
+          <fileset dir="lib" includes="maven-resolver-ant-tasks-*.jar"/>
         </classpath>
       </taskdef>
       ...
@@ -234,9 +234,9 @@ classpath="compile" equals scope="provided,system,compile"). Valid values are
 The layout attribute of the `<files>` element is only allowed when the dir attribute is also given and recognizes the
 following placeholders to refer to the coordinates of the currently processed artifact:
 
-* {groupId}, e.g. "org.eclipse.aether"
-* {groupIdDirs}, e.g. "org/eclipse/aether"
-* {artifactId}, e.g. "aether-api"
+* {groupId}, e.g. "org.apache.maven.resolver"
+* {groupIdDirs}, e.g. "org/apache/maven/resolver"
+* {artifactId}, e.g. "maven-resolver-api"
 * {version}, e.g. "1.0.0-20140518.181353-123"
 * {baseVersion}, e.g. "1.0.0-SNAPSHOT"
 * {extension}, e.g. "jar"

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index aa5bcf6..0bb6270 100644
--- a/build.xml
+++ b/build.xml
@@ -19,33 +19,33 @@
   under the License.
 -->
 
-<project xmlns:aether="antlib:org.apache.maven.aether.ant" default="deploy">
+<project xmlns:resolver="antlib:org.apache.maven.resolver.ant" default="deploy">
 
   <!--
-  This is an example Ant build file using the Aether Ant Tasks to compile, test, install and deploy the
-  aether-ant-tasks project itself. As a prerequisite, run "mvn package" first to assemble the
-  aether-ant-task.jar which this build file will load below.
+  This is an example Ant build file using the Maven Artifact Resolver Ant Tasks to compile, test, install and deploy the
+  maven-resolver-ant-tasks project itself. As a prerequisite, run "mvn package" first to assemble the
+  maven-resolver-ant-task.jar which this build file will load below.
   -->
 
-  <taskdef uri="antlib:org.apache.maven.aether.ant" resource="org/apache/maven/aether/ant/antlib.xml">
+  <taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
     <classpath>
-      <fileset dir="target" includes="aether-ant-tasks-*uber.jar"/>
+      <fileset dir="target" includes="maven-resolver-ant-tasks-*uber.jar"/>
     </classpath>
   </taskdef>
 
   <property name="build.dir" location="target/its"/>
 
-  <aether:localrepo dir="${build.dir}/local-repo"/>
+  <resolver:localrepo dir="${build.dir}/local-repo"/>
 
-  <aether:remoterepo id="ossrh" url="http://oss.sonatype.org/content/groups/staging" type="default"
+  <resolver:remoterepo id="ossrh" url="http://oss.sonatype.org/content/groups/staging" type="default"
                      releases="true" snapshots="true" updates="daily" checksums="fail"/>
 
-  <aether:remoterepos id="aether.repositories">
-    <aether:remoterepo refid="central"/>
-    <aether:remoterepo refid="ossrh"/>
-  </aether:remoterepos>
+  <resolver:remoterepos id="aether.repositories">
+    <resolver:remoterepo refid="central"/>
+    <resolver:remoterepo refid="ossrh"/>
+  </resolver:remoterepos>
 
-  <aether:pom file="pom.xml" id="pom"/>
+  <resolver:pom file="pom.xml" id="pom"/>
 
   <target name="clean">
     <delete dir="${build.dir}"/>
@@ -60,12 +60,12 @@
   <target name="compile" depends="process-resources">
     <mkdir dir="${build.dir}/classes"/>
 
-    <aether:resolve>
+    <resolver:resolve>
       <dependencies>
         <pom refid="pom"/>
       </dependencies>
       <path refid="cp.compile.main" classpath="compile"/>
-    </aether:resolve>
+    </resolver:resolve>
 
     <javac classpathref="cp.compile.main" srcdir="src/main/java" destdir="${build.dir}/classes" 
            includeAntRuntime="false" source="1.5" target="1.5" encoding="UTF-8" fork="true"/>
@@ -77,13 +77,13 @@
   <target name="test-compile" depends="process-test-resources">
     <mkdir dir="${build.dir}/test-classes"/>
 
-    <aether:resolve>
+    <resolver:resolve>
       <dependencies>
         <pom refid="pom"/>
       </dependencies>
       <path refid="cp.compile.test" classpath="test"/>
       <path refid="cp.runtime.test" scopes="compile,test"/>
-    </aether:resolve>
+    </resolver:resolve>
 
     <path id="cp.test">
       <path refid="cp.compile.test"/>
@@ -111,23 +111,23 @@
   </target>
 
   <target name="package" depends="test">
-    <jar destfile="${build.dir}/aether-ant-tasks-${pom.version}.jar" basedir="${build.dir}/classes"/>
-    <jar destfile="${build.dir}/aether-ant-tasks-${pom.version}-sources.jar" basedir="src/main/java"/>
+    <jar destfile="${build.dir}/maven-resolver-ant-tasks-${pom.version}.jar" basedir="${build.dir}/classes"/>
+    <jar destfile="${build.dir}/maven-resolver-ant-tasks-${pom.version}-sources.jar" basedir="src/main/java"/>
 
-    <aether:artifacts id="output">
-      <artifact file="${build.dir}/aether-ant-tasks-${pom.version}.jar"/>
-      <artifact file="${build.dir}/aether-ant-tasks-${pom.version}-sources.jar" classifier="sources"/>
-    </aether:artifacts>
+    <resolver:artifacts id="output">
+      <artifact file="${build.dir}/maven-resolver-ant-tasks-${pom.version}.jar"/>
+      <artifact file="${build.dir}/maven-resolver-ant-tasks-${pom.version}-sources.jar" classifier="sources"/>
+    </resolver:artifacts>
   </target>
 
   <target name="install" depends="package">
-    <aether:install artifactsref="output"/>
+    <resolver:install artifactsref="output"/>
   </target>
 
   <target name="deploy" depends="install">
-    <aether:deploy artifactsref="output">
+    <resolver:deploy artifactsref="output">
       <remoteRepo id="dist" url="file:///${build.dir}/dist-repo"/>
-    </aether:deploy>
+    </resolver:deploy>
   </target>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dc8f4ad..b67fc6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,31 +29,31 @@
     <version>27</version>
   </parent>
 
-  <groupId>org.apache.maven.aether</groupId>
-  <artifactId>aether-ant-tasks</artifactId>
+  <groupId>org.apache.maven.resolver</groupId>
+  <artifactId>maven-resolver-ant-tasks</artifactId>
   <version>1.1.0-SNAPSHOT</version>
 
-  <name>Aether Ant Tasks</name>
+  <name>Maven Artifact Resolver Ant Tasks</name>
   <description>
-    Ant tasks handling Maven artifacts using Aether and Maven Aether Provider.
+    Ant tasks handling Maven artifacts using Maven Artifact Resolver and Maven Resolver Provider.
   </description>
-  <url>http://maven.apache.org/aether-ant-tasks/</url>
+  <url>http://maven.apache.org/resolver-ant-tasks/</url>
   <inceptionYear>2010</inceptionYear>
 
   <scm>
-    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-aether.git</connection>
-    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-aether.git</developerConnection>
-    <url>https://github.com/apache/maven-aether/tree/${project.scm.tag}</url>
+    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-resolver.git</connection>
+    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-resolver.git</developerConnection>
+    <url>https://github.com/apache/maven-resolver/tree/${project.scm.tag}</url>
     <tag>ant-tasks</tag>
   </scm>
-  <!--issueManagement>
+  <issueManagement>
     <system>jira</system>
-    <url>https://issues.apache.org/jira/browse/</url>
+    <url>https://issues.apache.org/jira/browse/MRESOLVER</url>
   </issueManagement>
   <ciManagement>
     <system>Jenkins</system>
-    <url>https://builds.apache.org/job/</url>
-  </ciManagement-->
+    <url>https://builds.apache.org/job/maven-resolver-ant-tasks</url>
+  </ciManagement>
   <distributionManagement>
     <site>
       <id>apache.website</id>
@@ -64,7 +64,7 @@
   <properties>
     <mavenVersion>3.1.0</mavenVersion>
     <aetherVersion>1.0.1.v20141111</aetherVersion>
-    <maven.site.path>aether-archives/aether-ant-tasks-LATEST</maven.site.path>
+    <maven.site.path>resolver-archives/resolver-ant-tasks-LATEST</maven.site.path>
     <checkstyle.violation.ignore>LineLength,MagicNumber</checkstyle.violation.ignore>
   </properties>
 
@@ -291,18 +291,18 @@
               <relocations>
                 <relocation>
                   <pattern>org.eclipse.aether</pattern>
-                  <shadedPattern>org.apache.maven.aether.internal.ant.org.eclipse.aether</shadedPattern>
+                  <shadedPattern>org.apache.maven.resolver.internal.ant.org.eclipse.aether</shadedPattern>
                   <excludes>
                     <exclude>org.eclipse.aether.ant.**</exclude>
                   </excludes>
                 </relocation>
                 <relocation>
                   <pattern>org.sonatype.plexus</pattern>
-                  <shadedPattern>org.apache.maven.aether.internal.ant.org.sonatype.plexus</shadedPattern>
+                  <shadedPattern>org.apache.maven.resolver.internal.ant.org.sonatype.plexus</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache</pattern>
-                  <shadedPattern>org.apache.maven.aether.internal.ant.org.apache</shadedPattern>
+                  <shadedPattern>org.apache.maven.resolver.internal.ant.org.apache</shadedPattern>
                   <excludes>
                     <exclude>org.apache.tools.**</exclude>
                     <exclude>org.apache.maven.aether.**</exclude>
@@ -310,11 +310,11 @@
                 </relocation>
                 <relocation>
                   <pattern>org.codehaus</pattern>
-                  <shadedPattern>org.apache.maven.aether.internal.ant.org.codehaus</shadedPattern>
+                  <shadedPattern>org.apache.maven.resolver.internal.ant.org.codehaus</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.slf4j</pattern>
-                  <shadedPattern>org.apache.maven.aether.internal.ant.org.slf4j</shadedPattern>
+                  <shadedPattern>org.apache.maven.resolver.internal.ant.org.slf4j</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AetherUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AetherUtils.java b/src/main/java/org/apache/maven/aether/internal/ant/AetherUtils.java
deleted file mode 100644
index 9e2bbb0..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AetherUtils.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.File;
-
-import org.apache.maven.aether.internal.ant.types.RemoteRepositories;
-import org.apache.tools.ant.Project;
-
-class AetherUtils
-{
-
-    public static File findGlobalSettings( Project project )
-    {
-        File file = new File( new File( project.getProperty( "ant.home" ), "etc" ), Names.SETTINGS_XML );
-        if ( file.isFile() )
-        {
-            return file;
-        }
-        else
-        {
-            String mavenHome = getMavenHome( project );
-            if ( mavenHome != null )
-            {
-                return new File( new File( mavenHome, "conf" ), Names.SETTINGS_XML );
-            }
-        }
-    
-        return null;
-    }
-
-    public static String getMavenHome( Project project )
-    {
-        String mavenHome = project.getProperty( "maven.home" );
-        if ( mavenHome != null )
-        {
-            return mavenHome;
-        }
-        return System.getenv( "M2_HOME" );
-    }
-
-    public static File findUserSettings( Project project )
-    {
-        File userHome = new File( project.getProperty( "user.home" ) );
-        File file = new File( new File( userHome, ".ant" ), Names.SETTINGS_XML );
-        if ( file.isFile() )
-        {
-            return file;
-        }
-        else
-        {
-            return new File( new File( userHome, ".m2" ), Names.SETTINGS_XML );
-        }
-    }
-
-    public static RemoteRepositories getDefaultRepositories( Project project )
-    {
-        Object obj = project.getReference( Names.ID_DEFAULT_REPOS );
-        if ( obj instanceof RemoteRepositories )
-        {
-            return (RemoteRepositories) obj;
-        }
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntLogger.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntLogger.java b/src/main/java/org/apache/maven/aether/internal/ant/AntLogger.java
deleted file mode 100644
index d70f8a0..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntLogger.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 org.apache.tools.ant.Project;
-import org.eclipse.aether.spi.log.Logger;
-
-/**
- */
-class AntLogger
-    implements Logger
-{
-
-    private Project project;
-
-    public AntLogger( Project project )
-    {
-        this.project = project;
-    }
-
-    public void debug( String msg )
-    {
-        project.log( msg, Project.MSG_DEBUG );
-    }
-
-    public void debug( String msg, Throwable error )
-    {
-        project.log( msg, error, Project.MSG_DEBUG );
-    }
-
-    public boolean isDebugEnabled()
-    {
-        return true;
-    }
-
-    public boolean isWarnEnabled()
-    {
-        return true;
-    }
-
-    public void warn( String msg )
-    {
-        project.log( msg, Project.MSG_WARN );
-    }
-
-    public void warn( String msg, Throwable error )
-    {
-        project.log( msg, error, Project.MSG_WARN );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntModelResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntModelResolver.java b/src/main/java/org/apache/maven/aether/internal/ant/AntModelResolver.java
deleted file mode 100644
index 72b9802..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntModelResolver.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.File;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.model.Repository;
-import org.apache.maven.model.building.FileModelSource;
-import org.apache.maven.model.building.ModelSource;
-import org.apache.maven.model.resolution.InvalidRepositoryException;
-import org.apache.maven.model.resolution.ModelResolver;
-import org.apache.maven.model.resolution.UnresolvableModelException;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.impl.RemoteRepositoryManager;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.repository.RepositoryPolicy;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResolutionException;
-
-/**
- * A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
- * been initially specified and repositories discovered in dependency POMs are recessively merged into the search chain.
- * 
- */
-class AntModelResolver
-    implements ModelResolver
-{
-
-    private final RepositorySystemSession session;
-
-    private final String context;
-
-    private List<org.eclipse.aether.repository.RemoteRepository> repositories;
-
-    private final RepositorySystem repoSys;
-
-    private final RemoteRepositoryManager remoteRepositoryManager;
-
-    private final Set<String> repositoryIds;
-
-    public AntModelResolver( RepositorySystemSession session, String context, RepositorySystem repoSys,
-                             RemoteRepositoryManager remoteRepositoryManager, List<RemoteRepository> repositories )
-    {
-        this.session = session;
-        this.context = context;
-        this.repoSys = repoSys;
-        this.remoteRepositoryManager = remoteRepositoryManager;
-        this.repositories = repositories;
-        this.repositoryIds = new HashSet<String>();
-    }
-
-    private AntModelResolver( AntModelResolver original )
-    {
-        this.session = original.session;
-        this.context = original.context;
-        this.repoSys = original.repoSys;
-        this.remoteRepositoryManager = original.remoteRepositoryManager;
-        this.repositories = original.repositories;
-        this.repositoryIds = new HashSet<String>( original.repositoryIds );
-    }
-
-    public void addRepository( Repository repository )
-        throws InvalidRepositoryException
-    {
-        if ( !repositoryIds.add( repository.getId() ) )
-        {
-            return;
-        }
-
-        List<RemoteRepository> newRepositories = Collections.singletonList( convert( repository ) );
-
-        this.repositories =
-            remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true );
-    }
-
-    static RemoteRepository convert( Repository repository )
-    {
-        RemoteRepository.Builder builder =
-            new RemoteRepository.Builder( repository.getId(), repository.getLayout(), repository.getUrl() );
-        builder.setSnapshotPolicy( convert( repository.getSnapshots() ) );
-        builder.setReleasePolicy( convert( repository.getReleases() ) );
-        return builder.build();
-    }
-
-    private static RepositoryPolicy convert( org.apache.maven.model.RepositoryPolicy policy )
-    {
-        boolean enabled = true;
-        String checksums = RepositoryPolicy.CHECKSUM_POLICY_WARN;
-        String updates = RepositoryPolicy.UPDATE_POLICY_DAILY;
-
-        if ( policy != null )
-        {
-            enabled = policy.isEnabled();
-            if ( policy.getUpdatePolicy() != null )
-            {
-                updates = policy.getUpdatePolicy();
-            }
-            if ( policy.getChecksumPolicy() != null )
-            {
-                checksums = policy.getChecksumPolicy();
-            }
-        }
-
-        return new RepositoryPolicy( enabled, updates, checksums );
-    }
-
-    public ModelResolver newCopy()
-    {
-        return new AntModelResolver( this );
-    }
-
-    public ModelSource resolveModel( String groupId, String artifactId, String version )
-        throws UnresolvableModelException
-    {
-        Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );
-
-        try
-        {
-            ArtifactRequest request = new ArtifactRequest( pomArtifact, repositories, context );
-            pomArtifact = repoSys.resolveArtifact( session, request ).getArtifact();
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new UnresolvableModelException( "Failed to resolve POM for " + groupId + ":" + artifactId + ":"
-                + version + " due to " + e.getMessage(), groupId, artifactId, version, e );
-        }
-
-        File pomFile = pomArtifact.getFile();
-
-        return new FileModelSource( pomFile );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntRepoSys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntRepoSys.java b/src/main/java/org/apache/maven/aether/internal/ant/AntRepoSys.java
deleted file mode 100644
index b19e346..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntRepoSys.java
+++ /dev/null
@@ -1,825 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.maven.aether.internal.ant.types.Artifact;
-import org.apache.maven.aether.internal.ant.types.Artifacts;
-import org.apache.maven.aether.internal.ant.types.Authentication;
-import org.apache.maven.aether.internal.ant.types.Dependencies;
-import org.apache.maven.aether.internal.ant.types.Dependency;
-import org.apache.maven.aether.internal.ant.types.DependencyContainer;
-import org.apache.maven.aether.internal.ant.types.Exclusion;
-import org.apache.maven.aether.internal.ant.types.LocalRepository;
-import org.apache.maven.aether.internal.ant.types.Mirror;
-import org.apache.maven.aether.internal.ant.types.Pom;
-import org.apache.maven.aether.internal.ant.types.Proxy;
-import org.apache.maven.aether.internal.ant.types.RemoteRepositories;
-import org.apache.maven.aether.internal.ant.types.RemoteRepository;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.building.DefaultModelBuilderFactory;
-import org.apache.maven.model.building.DefaultModelBuildingRequest;
-import org.apache.maven.model.building.FileModelSource;
-import org.apache.maven.model.building.ModelBuilder;
-import org.apache.maven.model.building.ModelBuildingException;
-import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.model.resolution.ModelResolver;
-import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
-import org.apache.maven.settings.Server;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.building.DefaultSettingsBuilderFactory;
-import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
-import org.apache.maven.settings.building.SettingsBuilder;
-import org.apache.maven.settings.building.SettingsBuildingException;
-import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
-import org.apache.maven.settings.crypto.SettingsDecrypter;
-import org.apache.maven.settings.crypto.SettingsDecryptionResult;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.condition.Os;
-import org.apache.tools.ant.types.Reference;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.eclipse.aether.ConfigurationProperties;
-import org.eclipse.aether.DefaultRepositoryCache;
-import org.eclipse.aether.DefaultRepositorySystemSession;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.collection.CollectResult;
-import org.eclipse.aether.collection.DependencyCollectionException;
-import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
-import org.eclipse.aether.deployment.DeployRequest;
-import org.eclipse.aether.deployment.DeploymentException;
-import org.eclipse.aether.impl.DefaultServiceLocator;
-import org.eclipse.aether.impl.RemoteRepositoryManager;
-import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.repository.AuthenticationSelector;
-import org.eclipse.aether.repository.LocalRepositoryManager;
-import org.eclipse.aether.repository.MirrorSelector;
-import org.eclipse.aether.repository.ProxySelector;
-import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
-import org.eclipse.aether.spi.connector.transport.TransporterFactory;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.transport.classpath.ClasspathTransporterFactory;
-import org.eclipse.aether.transport.file.FileTransporterFactory;
-import org.eclipse.aether.transport.http.HttpTransporterFactory;
-import org.eclipse.aether.util.repository.AuthenticationBuilder;
-import org.eclipse.aether.util.repository.ConservativeAuthenticationSelector;
-import org.eclipse.aether.util.repository.DefaultAuthenticationSelector;
-import org.eclipse.aether.util.repository.DefaultMirrorSelector;
-import org.eclipse.aether.util.repository.DefaultProxySelector;
-
-/**
- */
-public class AntRepoSys
-{
-
-    private static final boolean OS_WINDOWS = Os.isFamily( "windows" );
-
-    private static final ModelBuilder MODEL_BUILDER = new DefaultModelBuilderFactory().newInstance();
-
-    private static final SettingsBuilder SETTINGS_BUILDER = new DefaultSettingsBuilderFactory().newInstance();
-
-    private static final SettingsDecrypter SETTINGS_DECRYPTER = new AntSettingsDecryptorFactory().newInstance();
-
-    private final Project project;
-
-    private final DefaultServiceLocator locator;
-
-    private RepositorySystem repoSys;
-
-    private RemoteRepositoryManager remoteRepoMan;
-
-    private File userSettings;
-
-    private File globalSettings;
-
-    private Settings settings;
-
-    private final List<Mirror> mirrors = new CopyOnWriteArrayList<Mirror>();
-
-    private final List<Proxy> proxies = new CopyOnWriteArrayList<Proxy>();
-
-    private final List<Authentication> authentications = new CopyOnWriteArrayList<Authentication>();
-
-    private LocalRepository localRepository;
-
-    private Pom defaultPom;
-
-    private static <T> boolean eq( T o1, T o2 )
-    {
-        return ( o1 == null ) ? o2 == null : o1.equals( o2 );
-    }
-
-    public static synchronized AntRepoSys getInstance( Project project )
-    {
-        Object obj = project.getReference( Names.ID );
-        if ( obj instanceof AntRepoSys )
-        {
-            return (AntRepoSys) obj;
-        }
-        AntRepoSys instance = new AntRepoSys( project );
-        project.addReference( Names.ID, instance );
-        instance.initDefaults();
-        return instance;
-    }
-
-    private AntRepoSys( Project project )
-    {
-        this.project = project;
-
-        locator = MavenRepositorySystemUtils.newServiceLocator();
-        locator.setErrorHandler( new AntServiceLocatorErrorHandler( project ) );
-        locator.setServices( Logger.class, new AntLogger( project ) );
-        locator.setServices( ModelBuilder.class, MODEL_BUILDER );
-        locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
-        locator.addService( TransporterFactory.class, FileTransporterFactory.class );
-        locator.addService( TransporterFactory.class, HttpTransporterFactory.class );
-        locator.addService( TransporterFactory.class, ClasspathTransporterFactory.class );
-    }
-
-    private void initDefaults()
-    {
-        RemoteRepository repo = new RemoteRepository();
-        repo.setProject( project );
-        repo.setId( "central" );
-        repo.setUrl( "http://repo1.maven.org/maven2/" );
-        project.addReference( Names.ID_CENTRAL, repo );
-
-        repo = new RemoteRepository();
-        repo.setProject( project );
-        repo.setRefid( new Reference( project, Names.ID_CENTRAL ) );
-        RemoteRepositories repos = new RemoteRepositories();
-        repos.setProject( project );
-        repos.addRemoterepo( repo );
-        project.addReference( Names.ID_DEFAULT_REPOS, repos );
-    }
-
-    public synchronized RepositorySystem getSystem()
-    {
-        if ( repoSys == null )
-        {
-            repoSys = locator.getService( RepositorySystem.class );
-            if ( repoSys == null )
-            {
-                throw new BuildException( "The repository system could not be initialized" );
-            }
-        }
-        return repoSys;
-    }
-
-    private synchronized RemoteRepositoryManager getRemoteRepoMan()
-    {
-        if ( remoteRepoMan == null )
-        {
-            remoteRepoMan = locator.getService( RemoteRepositoryManager.class );
-            if ( remoteRepoMan == null )
-            {
-                throw new BuildException( "The repository system could not be initialized" );
-            }
-        }
-        return remoteRepoMan;
-    }
-
-    public RepositorySystemSession getSession( Task task, LocalRepository localRepo )
-    {
-        DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
-
-        Map<Object, Object> configProps = new LinkedHashMap<Object, Object>();
-        configProps.put( ConfigurationProperties.USER_AGENT, getUserAgent() );
-        configProps.putAll( (Map<?, ?>) project.getProperties() );
-        processServerConfiguration( configProps );
-        session.setConfigProperties( configProps );
-
-        session.setOffline( isOffline() );
-        session.setUserProperties( project.getUserProperties() );
-
-        session.setProxySelector( getProxySelector() );
-        session.setMirrorSelector( getMirrorSelector() );
-        session.setAuthenticationSelector( getAuthSelector() );
-
-        session.setCache( new DefaultRepositoryCache() );
-
-        session.setRepositoryListener( new AntRepositoryListener( task ) );
-        session.setTransferListener( new AntTransferListener( task ) );
-
-        session.setLocalRepositoryManager( getLocalRepoMan( session, localRepo ) );
-
-        session.setWorkspaceReader( ProjectWorkspaceReader.getInstance() );
-
-        return session;
-    }
-
-    private String getUserAgent()
-    {
-        StringBuilder buffer = new StringBuilder( 128 );
-
-        buffer.append( "Apache-Ant/" ).append( project.getProperty( "ant.version" ) );
-        buffer.append( " (" );
-        buffer.append( "Java " ).append( System.getProperty( "java.version" ) );
-        buffer.append( "; " );
-        buffer.append( System.getProperty( "os.name" ) ).append( " " ).append( System.getProperty( "os.version" ) );
-        buffer.append( ")" );
-        buffer.append( " Aether" );
-
-        return buffer.toString();
-    }
-
-    private boolean isOffline()
-    {
-        String prop = project.getProperty( Names.PROPERTY_OFFLINE );
-        if ( prop != null )
-        {
-            return Boolean.parseBoolean( prop );
-        }
-        return getSettings().isOffline();
-    }
-
-    private void processServerConfiguration( Map<Object, Object> configProps )
-    {
-        Settings settings = getSettings();
-        for ( Server server : settings.getServers() )
-        {
-            if ( server.getConfiguration() != null )
-            {
-                Xpp3Dom dom = (Xpp3Dom) server.getConfiguration();
-                for ( int i = dom.getChildCount() - 1; i >= 0; i-- )
-                {
-                    Xpp3Dom child = dom.getChild( i );
-                    if ( "wagonProvider".equals( child.getName() ) )
-                    {
-                        dom.removeChild( i );
-                    }
-                    else if ( "httpHeaders".equals( child.getName() ) )
-                    {
-                        configProps.put( ConfigurationProperties.HTTP_HEADERS + "." + server.getId(),
-                                         getHttpHeaders( child ) );
-                    }
-                }
-
-                configProps.put( "aether.connector.wagon.config." + server.getId(), dom );
-            }
-
-            configProps.put( "aether.connector.perms.fileMode." + server.getId(), server.getFilePermissions() );
-            configProps.put( "aether.connector.perms.dirMode." + server.getId(), server.getDirectoryPermissions() );
-        }
-    }
-
-    private Map<String, String> getHttpHeaders( Xpp3Dom dom )
-    {
-        Map<String, String> headers = new HashMap<String, String>();
-        for ( int i = 0; i < dom.getChildCount(); i++ )
-        {
-            Xpp3Dom child = dom.getChild( i );
-            Xpp3Dom name = child.getChild( "name" );
-            Xpp3Dom value = child.getChild( "value" );
-            if ( name != null && name.getValue() != null )
-            {
-                headers.put( name.getValue(), ( value != null ) ? value.getValue() : null );
-            }
-        }
-        return Collections.unmodifiableMap( headers );
-    }
-
-    private File getDefaultLocalRepoDir()
-    {
-        String dir = project.getProperty( "maven.repo.local" );
-        if ( dir != null )
-        {
-            return project.resolveFile( dir );
-        }
-
-        Settings settings = getSettings();
-        if ( settings.getLocalRepository() != null )
-        {
-            return new File( settings.getLocalRepository() );
-        }
-
-        return new File( new File( project.getProperty( "user.home" ), ".m2" ), "repository" );
-    }
-
-    private LocalRepositoryManager getLocalRepoMan( RepositorySystemSession session, LocalRepository localRepo )
-    {
-        if ( localRepo == null )
-        {
-            localRepo = localRepository;
-        }
-
-        File repoDir;
-        if ( localRepo != null && localRepo.getDir() != null )
-        {
-            repoDir = localRepo.getDir();
-        }
-        else
-        {
-            repoDir = getDefaultLocalRepoDir();
-        }
-
-        org.eclipse.aether.repository.LocalRepository repo =
-            new org.eclipse.aether.repository.LocalRepository( repoDir );
-
-        return getSystem().newLocalRepositoryManager( session, repo );
-    }
-
-    private synchronized Settings getSettings()
-    {
-        if ( settings == null )
-        {
-            DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
-            request.setUserSettingsFile( getUserSettings() );
-            request.setGlobalSettingsFile( getGlobalSettings() );
-            request.setSystemProperties( getSystemProperties() );
-            request.setUserProperties( getUserProperties() );
-
-            try
-            {
-                settings = SETTINGS_BUILDER.build( request ).getEffectiveSettings();
-            }
-            catch ( SettingsBuildingException e )
-            {
-                project.log( "Could not process settings.xml: " + e.getMessage(), e, Project.MSG_WARN );
-            }
-
-            SettingsDecryptionResult result =
-                SETTINGS_DECRYPTER.decrypt( new DefaultSettingsDecryptionRequest( settings ) );
-            settings.setServers( result.getServers() );
-            settings.setProxies( result.getProxies() );
-        }
-        return settings;
-    }
-
-    private ProxySelector getProxySelector()
-    {
-        DefaultProxySelector selector = new DefaultProxySelector();
-
-        for ( Proxy proxy : proxies )
-        {
-            selector.add( ConverterUtils.toProxy( proxy ), proxy.getNonProxyHosts() );
-        }
-
-        Settings settings = getSettings();
-        for ( org.apache.maven.settings.Proxy proxy : settings.getProxies() )
-        {
-            AuthenticationBuilder auth = new AuthenticationBuilder();
-            auth.addUsername( proxy.getUsername() ).addPassword( proxy.getPassword() );
-            selector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(),
-                                                                   proxy.getPort(), auth.build() ),
-                          proxy.getNonProxyHosts() );
-        }
-
-        return selector;
-    }
-
-    private MirrorSelector getMirrorSelector()
-    {
-        DefaultMirrorSelector selector = new DefaultMirrorSelector();
-
-        for ( Mirror mirror : mirrors )
-        {
-            selector.add( mirror.getId(), mirror.getUrl(), mirror.getType(), false, mirror.getMirrorOf(), null );
-        }
-
-        Settings settings = getSettings();
-        for ( org.apache.maven.settings.Mirror mirror : settings.getMirrors() )
-        {
-            selector.add( String.valueOf( mirror.getId() ), mirror.getUrl(), mirror.getLayout(), false,
-                          mirror.getMirrorOf(), mirror.getMirrorOfLayouts() );
-        }
-
-        return selector;
-    }
-
-    private AuthenticationSelector getAuthSelector()
-    {
-        DefaultAuthenticationSelector selector = new DefaultAuthenticationSelector();
-
-        Collection<String> ids = new HashSet<String>();
-        for ( Authentication auth : authentications )
-        {
-            List<String> servers = auth.getServers();
-            if ( !servers.isEmpty() )
-            {
-                org.eclipse.aether.repository.Authentication a = ConverterUtils.toAuthentication( auth );
-                for ( String server : servers )
-                {
-                    if ( ids.add( server ) )
-                    {
-                        selector.add( server, a );
-                    }
-                }
-            }
-        }
-
-        Settings settings = getSettings();
-        for ( Server server : settings.getServers() )
-        {
-            AuthenticationBuilder auth = new AuthenticationBuilder();
-            auth.addUsername( server.getUsername() ).addPassword( server.getPassword() );
-            auth.addPrivateKey( server.getPrivateKey(), server.getPassphrase() );
-            selector.add( server.getId(), auth.build() );
-        }
-
-        return new ConservativeAuthenticationSelector( selector );
-    }
-
-    public synchronized void setUserSettings( File file )
-    {
-        if ( !eq( this.userSettings, file ) )
-        {
-            settings = null;
-        }
-        this.userSettings = file;
-    }
-
-    /* UT */File getUserSettings()
-    {
-        if ( userSettings == null )
-        {
-            userSettings = AetherUtils.findUserSettings( project );
-        }
-        return userSettings;
-    }
-
-    public void setGlobalSettings( File file )
-    {
-        if ( !eq( this.globalSettings, file ) )
-        {
-            settings = null;
-        }
-        this.globalSettings = file;
-    }
-
-    /* UT */File getGlobalSettings()
-    {
-        if ( globalSettings == null )
-        {
-            globalSettings = AetherUtils.findGlobalSettings( project );
-        }
-        return globalSettings;
-    }
-
-    public void addProxy( Proxy proxy )
-    {
-        proxies.add( proxy );
-    }
-
-    public void addMirror( Mirror mirror )
-    {
-        mirrors.add( mirror );
-    }
-
-    public void addAuthentication( Authentication authentication )
-    {
-        authentications.add( authentication );
-    }
-
-    public void setLocalRepository( LocalRepository localRepository )
-    {
-        this.localRepository = localRepository;
-    }
-
-    public Model loadModel( Task task, File pomFile, boolean local, RemoteRepositories remoteRepositories )
-    {
-        RepositorySystemSession session = getSession( task, null );
-
-        remoteRepositories =
-            remoteRepositories == null ? AetherUtils.getDefaultRepositories( project ) : remoteRepositories;
-
-        List<org.eclipse.aether.repository.RemoteRepository> repositories =
-            ConverterUtils.toRepositories( task.getProject(), session, remoteRepositories, getRemoteRepoMan() );
-
-        ModelResolver modelResolver =
-            new AntModelResolver( session, "project", getSystem(), getRemoteRepoMan(), repositories );
-
-        Settings settings = getSettings();
-
-        try
-        {
-            DefaultModelBuildingRequest request = new DefaultModelBuildingRequest();
-            request.setLocationTracking( true );
-            request.setProcessPlugins( false );
-            if ( local )
-            {
-                request.setPomFile( pomFile );
-                request.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_STRICT );
-            }
-            else
-            {
-                request.setModelSource( new FileModelSource( pomFile ) );
-                request.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
-            }
-            request.setSystemProperties( getSystemProperties() );
-            request.setUserProperties( getUserProperties() );
-            request.setProfiles( SettingsUtils.convert( settings.getProfiles() ) );
-            request.setActiveProfileIds( settings.getActiveProfiles() );
-            request.setModelResolver( modelResolver );
-            return MODEL_BUILDER.build( request ).getEffectiveModel();
-        }
-        catch ( ModelBuildingException e )
-        {
-            throw new BuildException( "Could not load POM " + pomFile + ": " + e.getMessage(), e );
-        }
-    }
-
-    private Properties getSystemProperties()
-    {
-        Properties props = new Properties();
-        getEnvProperties( props );
-        props.putAll( System.getProperties() );
-        ConverterUtils.addProperties( props, project.getProperties() );
-        return props;
-    }
-
-    private Properties getEnvProperties( Properties props )
-    {
-        if ( props == null )
-        {
-            props = new Properties();
-        }
-        boolean envCaseInsensitive = OS_WINDOWS;
-        for ( Map.Entry<String, String> entry : System.getenv().entrySet() )
-        {
-            String key = entry.getKey();
-            if ( envCaseInsensitive )
-            {
-                key = key.toUpperCase( Locale.ENGLISH );
-            }
-            key = "env." + key;
-            props.put( key, entry.getValue() );
-        }
-        return props;
-    }
-
-    private Properties getUserProperties()
-    {
-        return ConverterUtils.addProperties( null, project.getUserProperties() );
-    }
-
-    /**
-     * Sets the default POM.
-     */
-    public void setDefaultPom( Pom pom )
-    {
-        this.defaultPom = pom;
-    }
-
-    /**
-     * Returns the current default POM.
-     */
-    public Pom getDefaultPom()
-    {
-        return defaultPom;
-    }
-
-    public CollectResult collectDependencies( Task task, Dependencies dependencies, LocalRepository localRepository,
-                                              RemoteRepositories remoteRepositories )
-    {
-        RepositorySystemSession session = getSession( task, localRepository );
-
-        remoteRepositories =
-            remoteRepositories == null ? AetherUtils.getDefaultRepositories( project ) : remoteRepositories;
-
-        List<org.eclipse.aether.repository.RemoteRepository> repos =
-            ConverterUtils.toRepositories( project, session, remoteRepositories, getRemoteRepoMan() );
-
-        CollectRequest collectRequest = new CollectRequest();
-        collectRequest.setRequestContext( "project" );
-
-        for ( org.eclipse.aether.repository.RemoteRepository repo : repos )
-        {
-            task.getProject().log( "Using remote repository " + repo, Project.MSG_VERBOSE );
-            collectRequest.addRepository( repo );
-        }
-
-        if ( dependencies != null )
-        {
-            populateCollectRequest( collectRequest, task, session, dependencies, Collections.<Exclusion>emptyList() );
-        }
-
-        task.getProject().log( "Collecting dependencies", Project.MSG_VERBOSE );
-
-        CollectResult result;
-        try
-        {
-            result = getSystem().collectDependencies( session, collectRequest );
-        }
-        catch ( DependencyCollectionException e )
-        {
-            throw new BuildException( "Could not collect dependencies: " + e.getMessage(), e );
-        }
-
-        return result;
-    }
-
-    private void populateCollectRequest( CollectRequest collectRequest, Task task, RepositorySystemSession session,
-                                         Dependencies dependencies, List<Exclusion> exclusions )
-    {
-        List<Exclusion> globalExclusions = exclusions;
-        if ( !dependencies.getExclusions().isEmpty() )
-        {
-            globalExclusions = new ArrayList<Exclusion>( exclusions );
-            globalExclusions.addAll( dependencies.getExclusions() );
-        }
-
-        Collection<String> ids = new HashSet<String>();
-
-        for ( DependencyContainer container : dependencies.getDependencyContainers() )
-        {
-            if ( container instanceof Dependency )
-            {
-                Dependency dep = (Dependency) container;
-                ids.add( dep.getVersionlessKey() );
-                collectRequest.addDependency( ConverterUtils.toDependency( dep, globalExclusions, session ) );
-            }
-            else
-            {
-                populateCollectRequest( collectRequest, task, session, (Dependencies) container, globalExclusions );
-            }
-        }
-
-        if ( dependencies.getPom() != null )
-        {
-            Model model = dependencies.getPom().getModel( task );
-            for ( org.apache.maven.model.Dependency dep : model.getDependencies() )
-            {
-                Dependency dependency = new Dependency();
-                dependency.setArtifactId( dep.getArtifactId() );
-                dependency.setClassifier( dep.getClassifier() );
-                dependency.setGroupId( dep.getGroupId() );
-                dependency.setScope( dep.getScope() );
-                dependency.setType( dep.getType() );
-                dependency.setVersion( dep.getVersion() );
-                if ( ids.contains( dependency.getVersionlessKey() ) )
-                {
-                    project.log( "Ignoring dependency " + dependency.getVersionlessKey() + " from " + model.getId()
-                        + ", already declared locally", Project.MSG_VERBOSE );
-                    continue;
-                }
-                if ( dep.getSystemPath() != null && dep.getSystemPath().length() > 0 )
-                {
-                    dependency.setSystemPath( task.getProject().resolveFile( dep.getSystemPath() ) );
-                }
-                for ( org.apache.maven.model.Exclusion exc : dep.getExclusions() )
-                {
-                    Exclusion exclusion = new Exclusion();
-                    exclusion.setGroupId( exc.getGroupId() );
-                    exclusion.setArtifactId( exc.getArtifactId() );
-                    exclusion.setClassifier( "*" );
-                    exclusion.setExtension( "*" );
-                    dependency.addExclusion( exclusion );
-                }
-                collectRequest.addDependency( ConverterUtils.toDependency( dependency, globalExclusions, session ) );
-            }
-        }
-
-        if ( dependencies.getFile() != null )
-        {
-            List<Dependency> deps = readDependencies( dependencies.getFile() );
-            for ( Dependency dependency : deps )
-            {
-                if ( ids.contains( dependency.getVersionlessKey() ) )
-                {
-                    project.log( "Ignoring dependency " + dependency.getVersionlessKey() + " from "
-                                     + dependencies.getFile() + ", already declared locally", Project.MSG_VERBOSE );
-                    continue;
-                }
-                collectRequest.addDependency( ConverterUtils.toDependency( dependency, globalExclusions, session ) );
-            }
-        }
-    }
-
-    private List<Dependency> readDependencies( File file )
-    {
-        List<Dependency> dependencies = new ArrayList<Dependency>();
-        try
-        {
-            BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) );
-            try
-            {
-                for ( String line = reader.readLine(); line != null; line = reader.readLine() )
-                {
-                    int comment = line.indexOf( '#' );
-                    if ( comment >= 0 )
-                    {
-                        line = line.substring( 0, comment );
-                    }
-                    line = line.trim();
-                    if ( line.length() <= 0 )
-                    {
-                        continue;
-                    }
-                    Dependency dependency = new Dependency();
-                    dependency.setCoords( line );
-                    dependencies.add( dependency );
-                }
-            }
-            finally
-            {
-                reader.close();
-            }
-        }
-        catch ( IOException e )
-        {
-            throw new BuildException( "Cannot read " + file, e );
-        }
-        return dependencies;
-    }
-
-    public void install( Task task, Pom pom, Artifacts artifacts )
-    {
-        RepositorySystemSession session = getSession( task, null );
-
-        InstallRequest request = new InstallRequest();
-        request.setArtifacts( toArtifacts( task, session, pom, artifacts ) );
-
-        try
-        {
-            getSystem().install( session, request );
-        }
-        catch ( InstallationException e )
-        {
-            throw new BuildException( "Could not install artifacts: " + e.getMessage(), e );
-        }
-    }
-
-    public void deploy( Task task, Pom pom, Artifacts artifacts, RemoteRepository releaseRepository,
-                        RemoteRepository snapshotRepository )
-    {
-        RepositorySystemSession session = getSession( task, null );
-
-        DeployRequest request = new DeployRequest();
-        request.setArtifacts( toArtifacts( task, session, pom, artifacts ) );
-        boolean snapshot = request.getArtifacts().iterator().next().isSnapshot();
-        RemoteRepository distRepo = ( snapshot && snapshotRepository != null ) ? snapshotRepository : releaseRepository;
-        request.setRepository( ConverterUtils.toDistRepository( distRepo, session ) );
-
-        try
-        {
-            getSystem().deploy( session, request );
-        }
-        catch ( DeploymentException e )
-        {
-            throw new BuildException( "Could not deploy artifacts: " + e.getMessage(), e );
-        }
-    }
-
-    private List<org.eclipse.aether.artifact.Artifact> toArtifacts( Task task, RepositorySystemSession session,
-                                                                    Pom pom, Artifacts artifacts )
-    {
-        Model model = pom.getModel( task );
-        File pomFile = pom.getFile();
-
-        List<org.eclipse.aether.artifact.Artifact> results = new ArrayList<org.eclipse.aether.artifact.Artifact>();
-
-        org.eclipse.aether.artifact.Artifact pomArtifact =
-            new DefaultArtifact( model.getGroupId(), model.getArtifactId(), "pom", model.getVersion() ).setFile( pomFile );
-        results.add( pomArtifact );
-
-        for ( Artifact artifact : artifacts.getArtifacts() )
-        {
-            org.eclipse.aether.artifact.Artifact buildArtifact =
-                new DefaultArtifact( model.getGroupId(), model.getArtifactId(), artifact.getClassifier(),
-                                     artifact.getType(), model.getVersion() ).setFile( artifact.getFile() );
-            results.add( buildArtifact );
-        }
-
-        return results;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntRepositoryListener.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntRepositoryListener.java b/src/main/java/org/apache/maven/aether/internal/ant/AntRepositoryListener.java
deleted file mode 100644
index 6a7f325..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntRepositoryListener.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.io.FileNotFoundException;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.eclipse.aether.AbstractRepositoryListener;
-import org.eclipse.aether.RepositoryEvent;
-import org.eclipse.aether.transfer.MetadataNotFoundException;
-
-/**
- * Logs repository events like installed and unresolved artifacts and metadata.
- */
-class AntRepositoryListener
-    extends AbstractRepositoryListener
-{
-
-    private Task task;
-
-    public AntRepositoryListener( Task task )
-    {
-        this.task = task;
-    }
-
-    @Override
-    public void artifactInstalling( RepositoryEvent event )
-    {
-        task.log( "Installing " + event.getArtifact().getFile() + " to " + event.getFile() );
-    }
-
-    @Override
-    public void metadataInstalling( RepositoryEvent event )
-    {
-        task.log( "Installing " + event.getMetadata() + " to " + event.getFile() );
-    }
-
-    @Override
-    public void metadataResolved( RepositoryEvent event )
-    {
-        Exception e = event.getException();
-        if ( e != null )
-        {
-            if ( e instanceof MetadataNotFoundException )
-            {
-                task.log( e.getMessage(), Project.MSG_DEBUG );
-            }
-            else
-            {
-                task.log( e.getMessage(), e, Project.MSG_WARN );
-            }
-        }
-    }
-
-    @Override
-    public void metadataInvalid( RepositoryEvent event )
-    {
-        Exception exception = event.getException();
-
-        StringBuilder buffer = new StringBuilder( 256 );
-        buffer.append( "The metadata " );
-        if ( event.getMetadata().getFile() != null )
-        {
-            buffer.append( event.getMetadata().getFile() );
-        }
-        else
-        {
-            buffer.append( event.getMetadata() );
-        }
-
-        if ( exception instanceof FileNotFoundException )
-        {
-            buffer.append( " is inaccessible" );
-        }
-        else
-        {
-            buffer.append( " is invalid" );
-        }
-
-        if ( exception != null )
-        {
-            buffer.append( ": " );
-            buffer.append( exception.getMessage() );
-        }
-
-        task.log( buffer.toString(), exception, Project.MSG_WARN );
-    }
-
-    @Override
-    public void artifactDescriptorInvalid( RepositoryEvent event )
-    {
-        task.log( "The POM for " + event.getArtifact() + " is invalid"
-                      + ", transitive dependencies (if any) will not be available: "
-                      + event.getException().getMessage(),
-                  event.getException(), Project.MSG_WARN );
-    };
-
-    @Override
-    public void artifactDescriptorMissing( RepositoryEvent event )
-    {
-        task.log( "The POM for " + event.getArtifact() + " is missing, no dependency information available",
-                  Project.MSG_WARN );
-    };
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntSecDispatcher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntSecDispatcher.java b/src/main/java/org/apache/maven/aether/internal/ant/AntSecDispatcher.java
deleted file mode 100644
index 07de15c..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntSecDispatcher.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
-import org.sonatype.plexus.components.cipher.PlexusCipherException;
-import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
-
-/**
- */
-class AntSecDispatcher
-    extends DefaultSecDispatcher
-{
-
-    public AntSecDispatcher()
-    {
-        _configurationFile = "~/.m2/settings-security.xml";
-        try
-        {
-            _cipher = new DefaultPlexusCipher();
-        }
-        catch ( PlexusCipherException e )
-        {
-            e.printStackTrace();
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntServiceLocatorErrorHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntServiceLocatorErrorHandler.java b/src/main/java/org/apache/maven/aether/internal/ant/AntServiceLocatorErrorHandler.java
deleted file mode 100644
index 5816cf7..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntServiceLocatorErrorHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 org.apache.tools.ant.Project;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.impl.DefaultServiceLocator;
-
-/**
- */
-class AntServiceLocatorErrorHandler
-    extends DefaultServiceLocator.ErrorHandler
-{
-
-    private Project project;
-
-    public AntServiceLocatorErrorHandler( Project project )
-    {
-        this.project = project;
-    }
-
-    public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
-    {
-        String msg = "Could not initialize repository system";
-        if ( !RepositorySystem.class.equals( type ) )
-        {
-            msg += ", service " + type.getName() + " (" + impl.getName() + ") failed to initialize";
-        }
-        msg += ": " + exception.getMessage();
-        project.log( msg, exception, Project.MSG_ERR );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntSettingsDecryptorFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntSettingsDecryptorFactory.java b/src/main/java/org/apache/maven/aether/internal/ant/AntSettingsDecryptorFactory.java
deleted file mode 100644
index b22d20e..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntSettingsDecryptorFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.lang.reflect.Field;
-
-import org.apache.maven.settings.crypto.DefaultSettingsDecrypter;
-
-/**
- */
-class AntSettingsDecryptorFactory
-{
-
-    public DefaultSettingsDecrypter newInstance()
-    {
-        AntSecDispatcher secDispatcher = new AntSecDispatcher();
-
-        DefaultSettingsDecrypter decrypter = new DefaultSettingsDecrypter();
-
-        try
-        {
-            Field field = decrypter.getClass().getDeclaredField( "securityDispatcher" );
-            field.setAccessible( true );
-            field.set( decrypter, secDispatcher );
-        }
-        catch ( Exception e )
-        {
-            throw new IllegalStateException( e );
-        }
-
-        return decrypter;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/AntTransferListener.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/AntTransferListener.java b/src/main/java/org/apache/maven/aether/internal/ant/AntTransferListener.java
deleted file mode 100644
index d4faea4..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/AntTransferListener.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.Locale;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.eclipse.aether.transfer.AbstractTransferListener;
-import org.eclipse.aether.transfer.TransferCancelledException;
-import org.eclipse.aether.transfer.TransferEvent;
-import org.eclipse.aether.transfer.TransferResource;
-
-/**
- * Logs up- and downloads.
- */
-class AntTransferListener
-    extends AbstractTransferListener
-{
-
-    private Task task;
-
-    public AntTransferListener( Task task )
-    {
-        this.task = task;
-    }
-
-    @Override
-    public void transferInitiated( TransferEvent event )
-        throws TransferCancelledException
-    {
-        String msg = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
-        msg += " " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName();
-        task.log( msg );
-    }
-
-    @Override
-    public void transferCorrupted( TransferEvent event )
-        throws TransferCancelledException
-    {
-        TransferResource resource = event.getResource();
-
-        task.log( event.getException().getMessage() + " for " + resource.getRepositoryUrl()
-                      + resource.getResourceName(), Project.MSG_WARN );
-    }
-
-    @Override
-    public void transferSucceeded( TransferEvent event )
-    {
-        String msg = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded";
-        msg += " " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName();
-
-        long contentLength = event.getTransferredBytes();
-        if ( contentLength >= 0 )
-        {
-            String len = contentLength >= 1024 ? ( ( contentLength + 1023 ) / 1024 ) + " KB" : contentLength + " B";
-
-            String throughput = "";
-            long duration = System.currentTimeMillis() - event.getResource().getTransferStartTime();
-            if ( duration > 0 )
-            {
-                DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
-                double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
-                throughput = " at " + format.format( kbPerSec ) + " KB/sec";
-            }
-
-            msg += " (" + len + throughput + ")";
-        }
-        task.log( msg );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/b5f1ab9c/src/main/java/org/apache/maven/aether/internal/ant/ConverterUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/aether/internal/ant/ConverterUtils.java b/src/main/java/org/apache/maven/aether/internal/ant/ConverterUtils.java
deleted file mode 100644
index d6ff28f..0000000
--- a/src/main/java/org/apache/maven/aether/internal/ant/ConverterUtils.java
+++ /dev/null
@@ -1,227 +0,0 @@
-package org.apache.maven.aether.internal.ant;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.maven.aether.internal.ant.types.Authentication;
-import org.apache.maven.aether.internal.ant.types.Dependency;
-import org.apache.maven.aether.internal.ant.types.Exclusion;
-import org.apache.maven.aether.internal.ant.types.Proxy;
-import org.apache.maven.aether.internal.ant.types.RemoteRepositories;
-import org.apache.maven.aether.internal.ant.types.RemoteRepository;
-import org.apache.tools.ant.Project;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.ArtifactProperties;
-import org.eclipse.aether.artifact.ArtifactType;
-import org.eclipse.aether.artifact.ArtifactTypeRegistry;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.artifact.DefaultArtifactType;
-import org.eclipse.aether.impl.RemoteRepositoryManager;
-import org.eclipse.aether.repository.RepositoryPolicy;
-import org.eclipse.aether.util.repository.AuthenticationBuilder;
-
-/**
- * Utility methods to convert between Aether and Ant objects.
- */
-class ConverterUtils
-{
-
-    private static org.eclipse.aether.artifact.Artifact toArtifact( Dependency dependency, ArtifactTypeRegistry types )
-    {
-        ArtifactType type = types.get( dependency.getType() );
-        if ( type == null )
-        {
-            type = new DefaultArtifactType( dependency.getType() );
-        }
-
-        Map<String, String> props = null;
-        if ( "system".equals( dependency.getScope() ) && dependency.getSystemPath() != null )
-        {
-            props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, dependency.getSystemPath().getPath() );
-        }
-
-        Artifact artifact =
-            new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), null,
-                                 dependency.getVersion(), props, type );
-
-        return artifact;
-    }
-
-    public static org.eclipse.aether.repository.Authentication toAuthentication( Authentication auth )
-    {
-        if ( auth == null )
-        {
-            return null;
-        }
-        AuthenticationBuilder authBuilder = new AuthenticationBuilder();
-        authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() );
-        authBuilder.addPrivateKey( auth.getPrivateKeyFile(), auth.getPassphrase() );
-        return authBuilder.build();
-    }
-
-    public static org.eclipse.aether.graph.Dependency toDependency( Dependency dependency, List<Exclusion> exclusions,
-                                                                     RepositorySystemSession session )
-    {
-        return new org.eclipse.aether.graph.Dependency( toArtifact( dependency, session.getArtifactTypeRegistry() ),
-                                                         dependency.getScope(), false,
-                                                         toExclusions( dependency.getExclusions(), exclusions ) );
-    }
-
-    /**
-     * Converts the given ant repository type to an Aether repository instance with authentication and proxy filled in
-     * via the sessions' selectors.
-     */
-    public static org.eclipse.aether.repository.RemoteRepository toDistRepository( RemoteRepository repo,
-                                                                       RepositorySystemSession session )
-    {
-        org.eclipse.aether.repository.RemoteRepository result = toRepository( repo );
-        org.eclipse.aether.repository.RemoteRepository.Builder builder =
-            new org.eclipse.aether.repository.RemoteRepository.Builder( result );
-        builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( result ) );
-        builder.setProxy( session.getProxySelector().getProxy( result ) );
-        return builder.build();
-    }
-
-    private static org.eclipse.aether.graph.Exclusion toExclusion( Exclusion exclusion )
-    {
-        return new org.eclipse.aether.graph.Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(),
-                                                        exclusion.getClassifier(), exclusion.getExtension() );
-    }
-
-    private static Collection<org.eclipse.aether.graph.Exclusion> toExclusions( Collection<Exclusion> exclusions1,
-                                                                                 Collection<Exclusion> exclusions2 )
-    {
-        Collection<org.eclipse.aether.graph.Exclusion> results =
-            new LinkedHashSet<org.eclipse.aether.graph.Exclusion>();
-        if ( exclusions1 != null )
-        {
-            for ( Exclusion exclusion : exclusions1 )
-            {
-                results.add( toExclusion( exclusion ) );
-            }
-        }
-        if ( exclusions2 != null )
-        {
-            for ( Exclusion exclusion : exclusions2 )
-            {
-                results.add( toExclusion( exclusion ) );
-            }
-        }
-        return results;
-    }
-
-    private static RepositoryPolicy toPolicy( RemoteRepository.Policy policy, boolean enabled, String updates,
-                                              String checksums )
-    {
-        if ( policy != null )
-        {
-            enabled = policy.isEnabled();
-            if ( policy.getChecksums() != null )
-            {
-                checksums = policy.getChecksums();
-            }
-            if ( policy.getUpdates() != null )
-            {
-                updates = policy.getUpdates();
-            }
-        }
-        return new RepositoryPolicy( enabled, updates, checksums );
-    }
-
-    /**
-     * Adds every &lt;String, String>-entry in the map as a property to the given Properties.
-     */
-    public static Properties addProperties( Properties props, Map<?, ?> map )
-    {
-        if ( props == null )
-        {
-            props = new Properties();
-        }
-        for ( Map.Entry<?, ?> entry : map.entrySet() )
-        {
-            if ( entry.getKey() instanceof String && entry.getValue() instanceof String )
-            {
-                props.put( entry.getKey(), entry.getValue() );
-            }
-        }
-        return props;
-    }
-
-    public static org.eclipse.aether.repository.Proxy toProxy( Proxy proxy )
-    {
-        if ( proxy == null )
-        {
-            return null;
-        }
-        return new org.eclipse.aether.repository.Proxy( proxy.getType(), proxy.getHost(), proxy.getPort(),
-                                                         toAuthentication( proxy.getAuthentication() ) );
-    }
-
-    private static org.eclipse.aether.repository.RemoteRepository toRepository( RemoteRepository repo )
-    {
-        org.eclipse.aether.repository.RemoteRepository.Builder builder =
-            new org.eclipse.aether.repository.RemoteRepository.Builder( repo.getId(), repo.getType(), repo.getUrl() );
-        builder.setSnapshotPolicy( toPolicy( repo.getSnapshotPolicy(), repo.isSnapshots(), repo.getUpdates(),
-                                             repo.getChecksums() ) );
-        builder.setReleasePolicy( toPolicy( repo.getReleasePolicy(), repo.isReleases(), repo.getUpdates(),
-                                            repo.getChecksums() ) );
-        builder.setAuthentication( toAuthentication( repo.getAuthentication() ) );
-        return builder.build();
-    }
-
-    public static List<org.eclipse.aether.repository.RemoteRepository> toRepositories( Project project,
-                                                                          RepositorySystemSession session,
-                                                                          RemoteRepositories repos, RemoteRepositoryManager remoteRepositoryManager )
-    {
-        List<RemoteRepository> repositories;
-
-        if ( repos != null )
-        {
-            repositories = repos.getRepositories();
-        }
-        else
-        {
-            repositories = new ArrayList<RemoteRepository>();
-        }
-
-        List<org.eclipse.aether.repository.RemoteRepository> results =
-            new ArrayList<org.eclipse.aether.repository.RemoteRepository>();
-        for ( RemoteRepository repo : repositories )
-        {
-            results.add( toRepository( repo ) );
-        }
-
-        results =
-            remoteRepositoryManager.aggregateRepositories( session,
-                                                      Collections.<org.eclipse.aether.repository.RemoteRepository>emptyList(),
-                                                      results, true );
-
-        return results;
-    }
-
-}