maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raf...@apache.org
Subject svn commit: r641988 - in /maven/archetype/trunk: archetype-common/src/main/java/org/apache/maven/archetype/common/ archetype-common/src/main/java/org/apache/maven/archetype/downloader/ archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/ ar...
Date Thu, 27 Mar 2008 21:22:00 GMT
Author: rafale
Date: Thu Mar 27 14:21:54 2008
New Revision: 641988

URL: http://svn.apache.org/viewvc?rev=641988&view=rev
Log:
Fix for ARCHETYPE-150
the archetypeRepository/remoteRepositories are now handled in a better way

Modified:
    maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
    maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java
    maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java
    maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java
    maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
    maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java

Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
(original)
+++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultArchetypeArtifactManager.java
Thu Mar 27 14:21:54 2008
@@ -322,13 +322,13 @@
         catch ( DownloadException e )
         {
             e.printStackTrace ();
-            getLogger ().debug ( "OldArchetype don't exist", e );
+            getLogger ().debug ( "Archetype don't exist", e );
             return false;
         }
         catch ( DownloadNotFoundException e )
         {
             e.printStackTrace ();
-            getLogger ().debug ( "OldArchetype don't exist", e );
+            getLogger ().debug ( "Archetype don't exist", e );
             return false;
         }
     }

Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java
(original)
+++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java
Thu Mar 27 14:21:54 2008
@@ -8,6 +8,8 @@
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -31,27 +33,20 @@
                           String artifactId,
                           String version,
                           ArtifactRepository archetypeRepository,
-                          File localRepository,
-                          String[] remoteRepositories )
-        throws DownloadException, DownloadNotFoundException
-
-    {
-        return download( groupId, artifactId, version, archetypeRepository, localRepository,
remoteRepositories );
-    }
-
-    public File download( String groupId,
-                          String artifactId,
-                          String version,
-                          ArtifactRepository archetypeRepository,
                           ArtifactRepository localRepository,
                          List remoteRepositories )
         throws DownloadException, DownloadNotFoundException
    {
         Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version,
Artifact.SCOPE_RUNTIME, "jar" );
-        artifact.setRepository(archetypeRepository);
+//        artifact.setRepository(archetypeRepository);
+        List repositories = new ArrayList(remoteRepositories);
+//        if (repositories.isEmpty() && archetypeRepository != null)
+//        {
+//            repositories.add(archetypeRepository);
+//        }
         try
         {
-            artifactResolver.resolveAlways( artifact, remoteRepositories, localRepository
);
+            artifactResolver.resolveAlways( artifact, repositories, localRepository );
         }
         catch ( ArtifactResolutionException e )
         {
@@ -64,4 +59,28 @@
 
         return artifact.getFile();
     }
+//    public File downloadOld( String groupId,
+//                          String artifactId,
+//                          String version,
+//                          ArtifactRepository archetypeRepository,
+//                          ArtifactRepository localRepository,
+//                         List remoteRepositories )
+//        throws DownloadException, DownloadNotFoundException
+//   {
+//        Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version,
Artifact.SCOPE_RUNTIME, "jar" );
+//        try
+//        {
+//            artifactResolver.resolveAlways( artifact, remoteRepositories, localRepository
);
+//        }
+//        catch ( ArtifactResolutionException e )
+//        {
+//            throw new DownloadException( "Error downloading.", e );
+//        }
+//        catch ( ArtifactNotFoundException e )
+//        {
+//            throw new DownloadNotFoundException( "Requested download does not exist.",
e );
+//        }
+//
+//        return artifact.getFile();
+//    }
 }

Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java
(original)
+++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/Downloader.java
Thu Mar 27 14:21:54 2008
@@ -16,15 +16,15 @@
                           String artifactId,
                           String version,
                           ArtifactRepository archetypeRepository,
-                          File localRepository,
-                          String[] remoteRepositories )
-        throws DownloadException, DownloadNotFoundException;
-
-    public File download( String groupId,
-                          String artifactId,
-                          String version,
-                          ArtifactRepository archetypeRepository,
                           ArtifactRepository localRepository,
                           List remoteRepositories )
         throws DownloadException, DownloadNotFoundException;
+
+//    public File downloadOld( String groupId,
+//                          String artifactId,
+//                          String version,
+//                          ArtifactRepository archetypeRepository,
+//                          ArtifactRepository localRepository,
+//                          List remoteRepositories )
+//        throws DownloadException, DownloadNotFoundException;
 }

Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java
(original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CleanMojo.java
Thu Mar 27 14:21:54 2008
@@ -30,7 +30,8 @@
  *
  * @author rafale
  * @requiresProject false
- * @goal clean
+ * //@ //goal clean
+ * @deprecated 
  */
 public class CleanMojo
     extends AbstractMojo

Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
(original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
Thu Mar 27 14:21:54 2008
@@ -106,7 +106,9 @@
                 ad.getArtifactId() + "-repo" );
             repositories.add( archetypeRepository );
         }
-
+//        System.err.println("repositories"+repositories);
+//        System.err.println("archetypeRepository"+archetypeRepository);
+//        System.err.println("A request.getArchetypeRepository()"+request.getArchetypeRepository());
         if ( !archetypeArtifactManager.exists( ad.getGroupId(), ad.getArtifactId(),
             ad.getVersion(), archetypeRepository, localRepository, repositories ) )
         {

Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java?rev=641988&r1=641987&r2=641988&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
(original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
Thu Mar 27 14:21:54 2008
@@ -54,15 +54,6 @@
     /** @plexus.requirement */
     private org.apache.maven.archetype.Archetype archetype;
 
-    public void selectArchetype( ArchetypeGenerationRequest request, Boolean interactiveMode
)
-        throws
-        ArchetypeNotDefined,
-        UnknownArchetype,
-        UnknownGroup,
-        IOException,
-        PrompterException,
-        ArchetypeSelectionFailure{throw new UnsupportedOperationException("change method");}
-
     public void selectArchetype( ArchetypeGenerationRequest request, 
             Boolean interactiveMode, String catalogs )
         throws
@@ -225,9 +216,9 @@
 
         request.setArchetypeName( definition.getName() );
 
-        request.setArchetypeRepository( definition.getRepository() );
-
-//        request.setRemoteRepository( definition.getRepository() );
+        if (StringUtils.isNotEmpty(definition.getRepository())){
+            request.setArchetypeRepository( definition.getRepository() );
+        }
     }
 
     private Map getArchetypesByCatalog(String catalogs) {



Mime
View raw message