svn commit: r169221 - in /maven/components/trunk/maven-archetype/maven-archetype-core: pom.xml src/main/java/org/apache/maven/archetype/DefaultArchetype.java src/main/resources/META-INF/plexus/components.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r169221 - in /maven/components/trunk/maven-archetype/maven-archetype-core: pom.xml src/main/java/org/apache/maven/archetype/DefaultArchetype.java src/main/resources/META-INF/plexus/components.xml

brettporter
Administrator
Author: brett
Date: Sun May  8 19:13:33 2005
New Revision: 169221

URL: http://svn.apache.org/viewcvs?rev=169221&view=rev
Log:
update to latest maven-artifact

Modified:
    maven/components/trunk/maven-archetype/maven-archetype-core/pom.xml
    maven/components/trunk/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
    maven/components/trunk/maven-archetype/maven-archetype-core/src/main/resources/META-INF/plexus/components.xml

Modified: maven/components/trunk/maven-archetype/maven-archetype-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-archetype/maven-archetype-core/pom.xml?rev=169221&r1=169220&r2=169221&view=diff
==============================================================================
--- maven/components/trunk/maven-archetype/maven-archetype-core/pom.xml (original)
+++ maven/components/trunk/maven-archetype/maven-archetype-core/pom.xml Sun May  8 19:13:33 2005
@@ -24,14 +24,11 @@
       <artifactId>maven-artifact</artifactId>
       <version>2.0-SNAPSHOT</version>
     </dependency>
-<!--
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-http-lightweight</artifactId>
+      <artifactId>wagon-file</artifactId>
       <version>1.0-alpha-2</version>
-      <type>jar</type>
-      <scope>compile</scope>
+      <scope>test</scope>
     </dependency>
--->
   </dependencies>
 </model>

Modified: maven/components/trunk/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java?rev=169221&r1=169220&r2=169221&view=diff
==============================================================================
--- maven/components/trunk/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java (original)
+++ maven/components/trunk/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java Sun May  8 19:13:33 2005
@@ -16,31 +16,30 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.io.FileWriter;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Writer;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.maven.archetype.descriptor.ArchetypeDescriptor;
 import org.apache.maven.archetype.descriptor.ArchetypeDescriptorBuilder;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.construction.ArtifactConstructionSupport;
+import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.context.Context;
-
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Writer;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:[hidden email]">Jason van Zyl</a>
  * @version $Id$
@@ -53,14 +52,14 @@
     // ----------------------------------------------------------------------
 
     private VelocityComponent velocity;
-    
+
     private ArtifactResolver artifactResolver;
 
     // ----------------------------------------------------------------------
     // Implementation
     // ----------------------------------------------------------------------
-    
-    private ArtifactConstructionSupport artifactConstructionSupport = new ArtifactConstructionSupport();
+
+    private ArtifactFactory artifactFactory;
 
     // groupId = maven
     // artifactId = maven-foo-archetype
@@ -74,8 +73,8 @@
         // Download the archetype
         // ----------------------------------------------------------------------
 
-        Artifact archetypeArtifact =
-            artifactConstructionSupport.createArtifact( archetypeGroupId, archetypeArtifactId, archetypeVersion, Artifact.SCOPE_RUNTIME, "jar" );
+        Artifact archetypeArtifact = artifactFactory.createArtifact( archetypeGroupId, archetypeArtifactId,
+                                                                     archetypeVersion, Artifact.SCOPE_RUNTIME, "jar" );
 
         try
         {
@@ -114,7 +113,8 @@
 
             if ( is == null )
             {
-                throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR + " descriptor cannot be found." );
+                throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR +
+                    " descriptor cannot be found." );
             }
 
             descriptor = (ArchetypeDescriptor) builder.build( new InputStreamReader( is ) );
@@ -197,7 +197,8 @@
         }
     }
 
-    protected void processTemplate( String outputDirectory, Context context, String template, boolean packageInFileName, String packageName )
+    protected void processTemplate( String outputDirectory, Context context, String template, boolean packageInFileName,
+                                    String packageName )
         throws Exception
     {
         File f;

Modified: maven/components/trunk/maven-archetype/maven-archetype-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-archetype/maven-archetype-core/src/main/resources/META-INF/plexus/components.xml?rev=169221&r1=169220&r2=169221&view=diff
==============================================================================
--- maven/components/trunk/maven-archetype/maven-archetype-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/maven-archetype/maven-archetype-core/src/main/resources/META-INF/plexus/components.xml Sun May  8 19:13:33 2005
@@ -10,6 +10,9 @@
         <requirement>
           <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+        </requirement>
       </requirements>
     </component>
   </components>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]