diff --git a/maven-artifact-ant/sample.build.xml b/maven-artifact-ant/sample.build.xml index 13cf386d06..c37d02cba1 100644 --- a/maven-artifact-ant/sample.build.xml +++ b/maven-artifact-ant/sample.build.xml @@ -13,7 +13,9 @@ - + + + diff --git a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java index 57420e9c04..ac9f4e8fbf 100755 --- a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java +++ b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java @@ -26,13 +26,14 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.artifact.MavenMetadataSource; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.Dependency; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.FileList; -import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.Path; import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -67,7 +68,12 @@ public class DependenciesTask ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); - Set artifacts = new HashSet(); + ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE ); + MavenMetadataSource metadataSource = new MavenMetadataSource( resolver, (MavenProjectBuilder) lookup( + MavenProjectBuilder.ROLE ) ); + + Set artifacts = metadataSource.createArtifacts( dependencies, null, null ); +/* for ( Iterator i = dependencies.iterator(); i.hasNext(); ) { Dependency dependency = (Dependency) i.next(); @@ -76,10 +82,7 @@ public class DependenciesTask null ); artifacts.add( a ); } - - ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE ); - MavenMetadataSource metadataSource = new MavenMetadataSource( resolver, (MavenProjectBuilder) lookup( - MavenProjectBuilder.ROLE ) ); +*/ log( "Resolving dependencies..." ); diff --git a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Dependency.java b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Dependency.java deleted file mode 100755 index 31ff82dba1..0000000000 --- a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/Dependency.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.apache.maven.artifact.ant; - -/* - * Copyright 2001-2005 The Apache Software Foundation. - * - * Licensed 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. - */ - -/** - * TODO: describe - * - * @author Brett Porter - * @version $Id$ - */ -public class Dependency -{ - private String groupId; - private String artifactId; - private String version; - private String scope = "compile"; - private String type = "jar"; - - public String getGroupId() - { - return groupId; - } - - public void setGroupId( String groupId ) - { - this.groupId = groupId; - } - - public String getArtifactId() - { - return artifactId; - } - - public void setArtifactId( String artifactId ) - { - this.artifactId = artifactId; - } - - public String getVersion() - { - return version; - } - - public void setVersion( String version ) - { - this.version = version; - } - - public String getScope() - { - return scope; - } - - public void setScope( String scope ) - { - this.scope = scope; - } - - public String getType() - { - return type; - } - - public void setType( String type ) - { - this.type = type; - } - - public String toString() - { - return groupId + ":" + artifactId + ":" + version + ":" + type + " [scope = " + scope + "]"; - } -}