Author: jvanzyl
Date: Sun Nov 18 18:02:27 2007
New Revision: 596178

URL: http://svn.apache.org/viewvc?rev=596178&view=rev
Log:
o get rid of the wiki source, it's just too unreliable in production. replaced 
it with an internal catalog source
 and really in practice people will give them to developers to use or they will 
be pulled out of a repository

Added:
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java
      - copied, changed from r595896, 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
    maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
   (with props)
Removed:
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java
Modified:
    maven/sandbox/trunk/archetypeng/archetypeng-common/pom.xml
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java
    
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/repositories/central/archetype-catalog.xml

Modified: maven/sandbox/trunk/archetypeng/archetypeng-common/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/pom.xml?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-common/pom.xml (original)
+++ maven/sandbox/trunk/archetypeng/archetypeng-common/pom.xml Sun Nov 18 
18:02:27 2007
@@ -137,6 +137,12 @@
   </dependencies>
 
   <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
     <plugins>
       <plugin>
         <groupId>org.codehaus.modello</groupId>
@@ -379,10 +385,6 @@
                 <property name="test.projects.repository" 
value="repositories/central"></property>
 
                 <mkdir 
dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}"></mkdir>
-
-                <copy 
todir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}">
-                  <fileset 
dir="${basedir}/src/test/central-repository"></fileset>
-                </copy>
               </tasks>
             </configuration>
             <goals>

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
 Sun Nov 18 18:02:27 2007
@@ -23,7 +23,6 @@
 import org.apache.maven.archetype.generator.ArchetypeGenerator;
 import org.apache.maven.archetype.source.ArchetypeDataSource;
 import org.apache.maven.archetype.source.ArchetypeDataSourceException;
-import org.apache.maven.archetype.source.WikiArchetypeDataSource;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.PropertyUtils;
@@ -103,11 +102,6 @@
         else
         {
             archetypeCatalogProperties = new Properties();
-
-            archetypeCatalogProperties.setProperty( "sources", "wiki" );
-
-            archetypeCatalogProperties.setProperty( "wiki.url",
-                WikiArchetypeDataSource.DEFAULT_ARCHETYPE_INVENTORY_PAGE );
         }
 
         return getAvailableArchetypes( archetypeCatalogProperties );
@@ -142,7 +136,7 @@
         {
             try
             {
-                ArchetypeDataSource source = (ArchetypeDataSource) 
archetypeSources.get( "wiki" );
+                ArchetypeDataSource source = (ArchetypeDataSource) 
archetypeSources.get( "internal-catalog" );
 
                 archetypes.addAll( source.getArchetypes( new Properties() ) );
             }

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/CatalogArchetypeDataSource.java
 Sun Nov 18 18:02:27 2007
@@ -52,9 +52,9 @@
 
     public static String ARCHETYPE_CATALOG_FILENAME = "archetype-catalog.xml";
 
-    private ArchetypeCatalogXpp3Reader catalogReader = new 
ArchetypeCatalogXpp3Reader(  );
+    private ArchetypeCatalogXpp3Reader catalogReader = new 
ArchetypeCatalogXpp3Reader();
 
-    private ArchetypeCatalogXpp3Writer catalogWriter = new 
ArchetypeCatalogXpp3Writer(  );
+    private ArchetypeCatalogXpp3Writer catalogWriter = new 
ArchetypeCatalogXpp3Writer();
 
     private File USER_HOME = new File( System.getProperty( "user.home" ) );
 
@@ -69,18 +69,18 @@
 
         s = StringUtils.replace( s, "${user.home}", System.getProperty( 
"user.home" ) );
 
-        getLogger(  ).debug( "Using catalog " + s );
+        getLogger().debug( "Using catalog " + s );
 
         File catalogFile = new File( s );
 
-        if ( catalogFile.exists(  ) )
+        if ( catalogFile.exists() )
         {
 
             try
             {
                 ArchetypeCatalog catalog = readCatalog( new FileReader( 
catalogFile ) );
 
-                return createArchetypeMap( catalog, catalogFile.getParent() );
+                return createArchetypeMap( catalog );
             }
             catch ( FileNotFoundException e )
             {
@@ -89,49 +89,51 @@
         }
         else
         {
-            return new ArrayList(  );
+            return new ArrayList();
         }
     }
 
-    public void updateCatalog( Properties properties, Archetype archetype, 
Settings settings )
+    public void updateCatalog( Properties properties,
+                               Archetype archetype,
+                               Settings settings )
         throws ArchetypeDataSourceException
     {
         String s = properties.getProperty( ARCHETYPE_CATALOG_PROPERTY );
 
         s = StringUtils.replace( s, "${user.home}", System.getProperty( 
"user.home" ) );
 
-        getLogger(  ).debug( "Using catalog " + s );
+        getLogger().debug( "Using catalog " + s );
 
         File catalogFile = new File( s );
 
         ArchetypeCatalog catalog;
-        if ( catalogFile.exists(  ) )
+        if ( catalogFile.exists() )
         {
             try
             {
-                getLogger(  ).debug( "Reading the catalog " + catalogFile );
+                getLogger().debug( "Reading the catalog " + catalogFile );
                 catalog = readCatalog( new FileReader( catalogFile ) );
             }
             catch ( FileNotFoundException ex )
             {
-                getLogger(  ).debug( "Catalog file don't exist" );
-                catalog = new ArchetypeCatalog(  );
+                getLogger().debug( "Catalog file don't exist" );
+                catalog = new ArchetypeCatalog();
             }
         }
         else
         {
-            getLogger(  ).debug( "Catalog file don't exist" );
-            catalog = new ArchetypeCatalog(  );
+            getLogger().debug( "Catalog file don't exist" );
+            catalog = new ArchetypeCatalog();
         }
 
-        Iterator archetypes = catalog.getArchetypes(  ).iterator(  );
+        Iterator archetypes = catalog.getArchetypes().iterator();
         boolean found = false;
         Archetype newArchetype = archetype;
-        while ( !found && archetypes.hasNext(  ) )
+        while ( !found && archetypes.hasNext() )
         {
             Archetype a = (Archetype) archetypes.next();
-            if ( a.getGroupId(  ).equals( archetype.getGroupId(  ) ) && 
a.getArtifactId(  ).
-                equals( archetype.getArtifactId(  ) ) )
+            if ( a.getGroupId().equals( archetype.getGroupId() ) && 
a.getArtifactId().
+                equals( archetype.getArtifactId() ) )
             {
                 newArchetype = a;
                 found = true;
@@ -142,16 +144,17 @@
             catalog.addArchetype( newArchetype );
         }
 
-        newArchetype.setVersion( archetype.getVersion(  ) );
-        newArchetype.setRepository( archetype.getRepository(  ) );
-        newArchetype.setDescription( archetype.getDescription(  ) );
-        newArchetype.setProperties( archetype.getProperties(  ) );
-        newArchetype.setGoals( archetype.getGoals(  ) );
+        newArchetype.setVersion( archetype.getVersion() );
+        newArchetype.setRepository( archetype.getRepository() );
+        newArchetype.setDescription( archetype.getDescription() );
+        newArchetype.setProperties( archetype.getProperties() );
+        newArchetype.setGoals( archetype.getGoals() );
 
         writeLocalCatalog( catalog, catalogFile );
     }
 
-    protected void writeLocalCatalog( ArchetypeCatalog catalog, File 
catalogFile )
+    protected void writeLocalCatalog( ArchetypeCatalog catalog,
+                                      File catalogFile )
         throws ArchetypeDataSourceException
     {
         FileWriter writer = null;
@@ -170,20 +173,15 @@
         }
     }
 
-    protected List createArchetypeMap( ArchetypeCatalog archetypeCatalog, 
String repository )
+    protected List createArchetypeMap( ArchetypeCatalog archetypeCatalog )
         throws ArchetypeDataSourceException
     {
-        List archetypes = new ArrayList(  );
+        List archetypes = new ArrayList();
 
-        for ( Iterator i = archetypeCatalog.getArchetypes(  ).iterator(  ); 
i.hasNext(  ); )
+        for ( Iterator i = archetypeCatalog.getArchetypes().iterator(); 
i.hasNext(); )
         {
             Archetype archetype = (Archetype) i.next();
 
-            if (archetype.getRepository() == null)
-            {
-                archetype.setRepository(repository);
-            }
-
             archetypes.add( archetype );
         }
 
@@ -215,7 +213,8 @@
     {
         ArchetypeDataSourceDescriptor d = new ArchetypeDataSourceDescriptor();
 
-        d.addParameter( ARCHETYPE_CATALOG_PROPERTY, String.class, 
DEFAULT_ARCHETYPE_CATALOG.getAbsolutePath(), "The repository URL where the 
archetype catalog resides." );
+        d.addParameter( ARCHETYPE_CATALOG_PROPERTY, String.class, 
DEFAULT_ARCHETYPE_CATALOG.getAbsolutePath(),
+            "The repository URL where the archetype catalog resides." );
 
         return d;
     }

Copied: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java
 (from r595896, 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java)
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java?p2=maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java&p1=maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java&r1=595896&r2=596178&rev=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/InternalCatalogArchetypeDataSource.java
 Sun Nov 18 18:02:27 2007
@@ -24,188 +24,32 @@
 
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.io.Reader;
 import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.List;
 import java.util.Properties;
 
 /**
- * @plexus.component role-hint="remote-catalog"
  * @author Jason van Zyl
+ * @plexus.component role-hint="internal-catalog"
  */
-public class RemoteCatalogArchetypeDataSource
+public class InternalCatalogArchetypeDataSource
     extends CatalogArchetypeDataSource
 {
-    public static String REPOSITORY_PROPERTY = "repository";
-
-//    /**
-//     * @plexus.requirement
-//     */
-//    private PlexusContainer container;
-//
-//    /**
-//     * @plexus.requirement
-//     */
-//    private WagonManager wagonManager;
-
     public List getArchetypes( Properties properties )
         throws ArchetypeDataSourceException
     {
-        String repository = properties.getProperty( REPOSITORY_PROPERTY );
-        
-        if ( repository == null )
-        {
-            throw new ArchetypeDataSourceException( "To use the remote catalog 
you must specify the 'remote-catalog.repository' property correctly in your 
~/.m2/archetype-catalog.properties file." );
-        }
-        
-        try
-        {
-            if ( repository.endsWith( "/" ) )
-            {
-                repository = repository.substring( 0, repository.length(  ) - 
1 );
-            }
-
-            URL url = new URL( repository + "/" + "archetype-catalog.xml" );
+        Reader reader = new InputStreamReader(
+            getClass().getClassLoader().getResourceAsStream( 
"archetype-catalog.xml" ) );
 
-            return createArchetypeMap( readCatalog( new InputStreamReader( 
url.openStream(  ) ) ), repository );
-        }
-        catch ( MalformedURLException e )
-        {
-            throw new ArchetypeDataSourceException( "Invalid URL provided for 
archetype registry.", e );
-        }
-        catch ( IOException e )
-        {
-            throw new ArchetypeDataSourceException( "Error reading archetype 
registry.", e );
-        }
+        return createArchetypeMap( readCatalog( reader ) );
     }
 
-    public void updateCatalog( Properties properties, Archetype archetype, 
Settings settings )
+    public void updateCatalog( Properties properties,
+                               Archetype archetype,
+                               Settings settings )
         throws ArchetypeDataSourceException
     {
         throw new ArchetypeDataSourceException( "Not supported yet." );
     }
-
-//    // Stealed from the embedder in trunk on 2007-10-04
-//    // then adapted
-//    private void artifactTransferMechanism( MavenExecutionRequest request, 
Configuration configuration, Settings settings )
-//        throws MavenEmbedderException
-//    {
-//        // 
------------------------------------------------------------------------
-//        // Artifact Transfer Mechanism
-//        //
-//        //
-//        // 
------------------------------------------------------------------------
-//
-//        if ( settings.isOffline() )
-//        {
-//            getLogger().info( "You are working in offline mode." );
-//
-//            wagonManager.setOnline( false );
-//        }
-//        else
-//        {
-//            wagonManager.findAndRegisterWagons( n );
-//
-//            wagonManager.setInteractive( settings.isInteractiveMode() );
-//
-//            wagonManager.setDownloadMonitor( request.getTransferListener() );
-//
-//            wagonManager.setOnline( true );
-//        }
-//
-//        try
-//        {
-//            resolveParameters( settings );
-//        }
-//        catch ( Exception e )
-//        {
-//            throw new MavenEmbedderException(
-//                "Unable to configure Maven for execution",
-//                e );
-//        }
-//    }
-//
-//    // Stealed from the embedder in trunk on 2007-10-04
-//    // then adapted
-//    private void resolveParameters( Settings settings )
-//        throws ComponentLookupException, ComponentLifecycleException, 
SettingsConfigurationException
-//    {
-//        WagonManager wagonManager = (WagonManager) container.lookup( 
WagonManager.ROLE );
-//
-//        try
-//        {
-//            Proxy proxy = settings.getActiveProxy();
-//
-//            if ( proxy != null )
-//            {
-//                if ( proxy.getHost() == null )
-//                {
-//                    throw new SettingsConfigurationException( "Proxy in 
settings.xml has no host" );
-//                }
-//
-//                wagonManager.addProxy(
-//                    proxy.getProtocol(),
-//                    proxy.getHost(),
-//                    proxy.getPort(),
-//                    proxy.getUsername(),
-//                    proxy.getPassword(),
-//                    proxy.getNonProxyHosts() );
-//            }
-//
-//            for ( Iterator i = settings.getServers().iterator(); 
i.hasNext(); )
-//            {
-//                Server server = (Server) i.next();
-//
-//                wagonManager.addAuthenticationInfo(
-//                    server.getId(),
-//                    server.getUsername(),
-//                    server.getPassword(),
-//                    server.getPrivateKey(),
-//                    server.getPassphrase() );
-//
-//                wagonManager.addPermissionInfo(
-//                    server.getId(),
-//                    server.getFilePermissions(),
-//                    server.getDirectoryPermissions() );
-//
-//                if ( server.getConfiguration() != null )
-//                {
-//                    wagonManager.addConfiguration(
-//                        server.getId(),
-//                        (Xpp3Dom) server.getConfiguration() );
-//                }
-//            }
-//
-//            RepositoryPermissions defaultPermissions = new 
RepositoryPermissions();
-//
-//            defaultPermissions.setDirectoryMode( "775" );
-//
-//            defaultPermissions.setFileMode( "664" );
-//
-//            wagonManager.setDefaultRepositoryPermissions( defaultPermissions 
);
-//
-//            for ( Iterator i = settings.getMirrors().iterator(); 
i.hasNext(); )
-//            {
-//                Mirror mirror = (Mirror) i.next();
-//
-//                wagonManager.addMirror(
-//                    mirror.getId(),
-//                    mirror.getMirrorOf(),
-//                    mirror.getUrl() );
-//            }
-//        }
-//        finally
-//        {
-//            container.release( wagonManager );
-//        }
-//    }
-
-    public ArchetypeDataSourceDescriptor getDescriptor()
-    {
-        ArchetypeDataSourceDescriptor d = new ArchetypeDataSourceDescriptor();
-
-        d.addParameter( REPOSITORY_PROPERTY, String.class, 
"http://repo1.maven.org/maven2";, "The repository URL where the archetype 
catalog resides." );
-
-        return d;
-    }
-}
+}
\ No newline at end of file

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java
 Sun Nov 18 18:02:27 2007
@@ -20,6 +20,7 @@
 package org.apache.maven.archetype.source;
 
 import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.settings.Settings;
 
 import java.io.IOException;
@@ -36,17 +37,10 @@
 public class RemoteCatalogArchetypeDataSource
     extends CatalogArchetypeDataSource
 {
-    public static String REPOSITORY_PROPERTY = "repository";
+    /** @plexus.requirement */
+    private WagonManager wagonManager;
 
-//    /**
-//     * @plexus.requirement
-//     */
-//    private PlexusContainer container;
-//
-//    /**
-//     * @plexus.requirement
-//     */
-//    private WagonManager wagonManager;
+    public static String REPOSITORY_PROPERTY = "repository";
 
     public List getArchetypes( Properties properties )
         throws ArchetypeDataSourceException
@@ -64,10 +58,10 @@
             {
                 repository = repository.substring( 0, repository.length(  ) - 
1 );
             }
-
+                        
             URL url = new URL( repository + "/" + "archetype-catalog.xml" );
 
-            return createArchetypeMap( readCatalog( new InputStreamReader( 
url.openStream(  ) ) ), repository );
+            return createArchetypeMap( readCatalog( new InputStreamReader( 
url.openStream(  ) ) ) );
         }
         catch ( MalformedURLException e )
         {
@@ -84,121 +78,6 @@
     {
         throw new ArchetypeDataSourceException( "Not supported yet." );
     }
-
-//    // Stealed from the embedder in trunk on 2007-10-04
-//    // then adapted
-//    private void artifactTransferMechanism( MavenExecutionRequest request, 
Configuration configuration, Settings settings )
-//        throws MavenEmbedderException
-//    {
-//        // 
------------------------------------------------------------------------
-//        // Artifact Transfer Mechanism
-//        //
-//        //
-//        // 
------------------------------------------------------------------------
-//
-//        if ( settings.isOffline() )
-//        {
-//            getLogger().info( "You are working in offline mode." );
-//
-//            wagonManager.setOnline( false );
-//        }
-//        else
-//        {
-//            wagonManager.findAndRegisterWagons( n );
-//
-//            wagonManager.setInteractive( settings.isInteractiveMode() );
-//
-//            wagonManager.setDownloadMonitor( request.getTransferListener() );
-//
-//            wagonManager.setOnline( true );
-//        }
-//
-//        try
-//        {
-//            resolveParameters( settings );
-//        }
-//        catch ( Exception e )
-//        {
-//            throw new MavenEmbedderException(
-//                "Unable to configure Maven for execution",
-//                e );
-//        }
-//    }
-//
-//    // Stealed from the embedder in trunk on 2007-10-04
-//    // then adapted
-//    private void resolveParameters( Settings settings )
-//        throws ComponentLookupException, ComponentLifecycleException, 
SettingsConfigurationException
-//    {
-//        WagonManager wagonManager = (WagonManager) container.lookup( 
WagonManager.ROLE );
-//
-//        try
-//        {
-//            Proxy proxy = settings.getActiveProxy();
-//
-//            if ( proxy != null )
-//            {
-//                if ( proxy.getHost() == null )
-//                {
-//                    throw new SettingsConfigurationException( "Proxy in 
settings.xml has no host" );
-//                }
-//
-//                wagonManager.addProxy(
-//                    proxy.getProtocol(),
-//                    proxy.getHost(),
-//                    proxy.getPort(),
-//                    proxy.getUsername(),
-//                    proxy.getPassword(),
-//                    proxy.getNonProxyHosts() );
-//            }
-//
-//            for ( Iterator i = settings.getServers().iterator(); 
i.hasNext(); )
-//            {
-//                Server server = (Server) i.next();
-//
-//                wagonManager.addAuthenticationInfo(
-//                    server.getId(),
-//                    server.getUsername(),
-//                    server.getPassword(),
-//                    server.getPrivateKey(),
-//                    server.getPassphrase() );
-//
-//                wagonManager.addPermissionInfo(
-//                    server.getId(),
-//                    server.getFilePermissions(),
-//                    server.getDirectoryPermissions() );
-//
-//                if ( server.getConfiguration() != null )
-//                {
-//                    wagonManager.addConfiguration(
-//                        server.getId(),
-//                        (Xpp3Dom) server.getConfiguration() );
-//                }
-//            }
-//
-//            RepositoryPermissions defaultPermissions = new 
RepositoryPermissions();
-//
-//            defaultPermissions.setDirectoryMode( "775" );
-//
-//            defaultPermissions.setFileMode( "664" );
-//
-//            wagonManager.setDefaultRepositoryPermissions( defaultPermissions 
);
-//
-//            for ( Iterator i = settings.getMirrors().iterator(); 
i.hasNext(); )
-//            {
-//                Mirror mirror = (Mirror) i.next();
-//
-//                wagonManager.addMirror(
-//                    mirror.getId(),
-//                    mirror.getMirrorOf(),
-//                    mirror.getUrl() );
-//            }
-//        }
-//        finally
-//        {
-//            container.release( wagonManager );
-//        }
-//    }
 
     public ArchetypeDataSourceDescriptor getDescriptor()
     {

Added: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml?rev=596178&view=auto
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
 (added)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
 Sun Nov 18 18:02:27 2007
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-catalog>
+  <archetypes>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-basic-jsf</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a web application with 
Hibernate, Spring and JSF</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-basic-spring</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a web application with 
Hibernate, Spring and Spring MVC</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-basic-struts</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a web application with 
Hibernate, Spring and Struts 2</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-basic-tapestry</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a web application with 
Hibernate, Spring and Tapestry 4</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-core</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a jar application with 
Hibernate and Spring and XFire</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-modular-jsf</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a modular application with 
Hibernate, Spring and JSF</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-modular-spring</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a modular application with 
Hibernate, Spring and Spring MVC</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-modular-struts</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a modular application with 
Hibernate, Spring and Struts 2</description>
+    </archetype>
+    <archetype>
+      <groupId>org.appfuse.archetypes</groupId>
+      <artifactId>appfuse-modular-tapestry</artifactId>
+      <version>2.0</version>
+      <repository>http://static.appfuse.org/releases</repository>
+      <description>AppFuse archetype for creating a modular application with 
Hibernate, Spring and Tapestry 4</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-j2ee-simple</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A simple J2EE Java application</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-marmalade-mojo</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A Maven plugin development project using 
marmalade</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-mojo</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A Maven Java plugin development project</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-portlet</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A simple portlet application</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-profiles</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description></description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-quickstart</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description></description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-simple</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description></description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-site-simple</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A simple site generation project</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-site</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A more complex site project</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>maven-archetype-webapp</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A simple Java web application</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-archetype-starter</artifactId>
+      <version>2.0.9-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A starter Struts 2 application with Sitemesh, DWR, and 
Spring</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-archetype-blank</artifactId>
+      <version>2.0.9-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A minimal Struts 2 application</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-archetype-portlet</artifactId>
+      <version>2.0.9-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A minimal Struts 2 application that can be deployed as a 
portlet</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-archetype-dbportlet</artifactId>
+      <version>2.0.9-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A starter Struts 2 portlet that demonstrates a simple CRUD 
interface with db backing</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-archetype-plugin</artifactId>
+      <version>2.0.9-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A Struts 2 plugin</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.shale</groupId>
+      <artifactId>shale-archetype-blank</artifactId>
+      <version>1.0.3-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>A blank Shale web application with JSF</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.myfaces.adfbuild</groupId>
+      <artifactId>maven-adf-archetype</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      
<repository>http://people.apache.org/repo/m2-snapshot-repository</repository>
+      <description>Archetype to ease the burden of creating a new application 
based with ADF</description>
+    </archetype>
+    <archetype>
+      <groupId>net.databinder</groupId>
+      <artifactId>data-app</artifactId>
+      <version>0.4</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A new Databinder application with sources and 
resources.</description>
+    </archetype>
+    <archetype>
+      <groupId>org.jini.maven-jini-plugin</groupId>
+      <artifactId>jini-service-archetype</artifactId>
+      <version>2.0</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>Archetype for Jini service project creation</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>softeu-archetype-seam</artifactId>
+      <version>RELEASE</version>
+      <repository>http://maven.softeu.cz/</repository>
+      <description>JSF+Facelets+Seam Archetype</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>softeu-archetype-seam-simple</artifactId>
+      <version>RELEASE</version>
+      <repository>http://maven.softeu.cz/</repository>
+      <description>JSF+Facelets+Seam (no persistence) Archetype</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.maven.archetypes</groupId>
+      <artifactId>softeu-archetype-jsf</artifactId>
+      <version>RELEASE</version>
+      <repository>http://maven.softeu.cz/</repository>
+      <description>JSF+Facelets Archetype</description>
+    </archetype>
+    <archetype>
+      <groupId>com.rfc.maven.archetypes</groupId>
+      <artifactId>jpa-maven-archetype</artifactId>
+      <version>RELEASE</version>
+      <repository>http://maven.rodcoffin.com/repo</repository>
+      <description>JPA application</description>
+    </archetype>
+    <archetype>
+      <groupId>org.springframework.osgi</groupId>
+      <artifactId>spring-osgi-bundle-archetype</artifactId>
+      <version>1.0-m3-SNAPSHOT</version>
+      
<repository>http://static.springframework.org/maven2-snapshots</repository>
+      <description>Spring-OSGi archetype</description>
+    </archetype>
+    <archetype>
+      <groupId>com.atlassian.maven.archetypes</groupId>
+      <artifactId>confluence-plugin-archetype</artifactId>
+      <version>RELEASE</version>
+      <repository>http://repository.atlassian.com/maven2</repository>
+      <description>Atlassian Confluence plugin archetype</description>
+    </archetype>
+    <archetype>
+      <groupId>net.sf.maven-har</groupId>
+      <artifactId>maven-archetype-har</artifactId>
+      <version>0.9</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>Hibernate Archive</description>
+    </archetype>
+    <archetype>
+      <groupId>net.sf.maven-sar</groupId>
+      <artifactId>maven-archetype-sar</artifactId>
+      <version>0.9</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>JBoss Service Archive</description>
+    </archetype>
+    <archetype>
+      <groupId>org.apache.wicket</groupId>
+      <artifactId>wicket-archetype-quickstart</artifactId>
+      <version>1.3.0-beta3</version>
+      <repository>http://repo1.maven.org/maven2</repository>
+      <description>A simple Apache Wicket project</description>
+    </archetype>
+  </archetypes>
+</archetype-catalog>
+

Propchange: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/resources/archetype-catalog.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
 Sun Nov 18 18:02:27 2007
@@ -74,9 +74,7 @@
 
         assertTrue( wikiSource.exists() );
 
-        p.setProperty( WikiArchetypeDataSource.URL, 
wikiSource.toURI().toURL().toExternalForm() );
-
-        ArchetypeDataSource ads = new WikiArchetypeDataSource();
+        ArchetypeDataSource ads = new InternalCatalogArchetypeDataSource();
 
         sink.putArchetypes( ads, p, writer );
 

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java
 Sun Nov 18 18:02:27 2007
@@ -15,13 +15,7 @@
     {
         Properties p = new Properties();
 
-        File wikiSource = new File( getBasedir(), 
"src/test/sources/wiki/wiki-source.txt" );
-
-        assertTrue( wikiSource.exists() );
-
-        p.setProperty( WikiArchetypeDataSource.URL, 
wikiSource.toURI().toURL().toExternalForm() );
-
-        ArchetypeDataSource ads = new WikiArchetypeDataSource();
+        ArchetypeDataSource ads = new InternalCatalogArchetypeDataSource();
 
         List archetypes = ads.getArchetypes( p );
 

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/test/ArchetypeGenerationTest.java
 Sun Nov 18 18:02:27 2007
@@ -46,20 +46,25 @@
 
         ArtifactRepository localRepository = registryManager.createRepository(
             new File( getBasedir(), "target/test-classes/repositories/local" )
-            .toURI().toURL().toExternalForm(), "local-repo" );
+                .toURI().toURL().toExternalForm(), "local-repo" );
 
         Properties catalogProperties = new Properties();
-        catalogProperties.setProperty("sources", "remote-catalog");
-        catalogProperties.setProperty("remote-catalog.repository",
+
+        catalogProperties.setProperty( "sources", "remote-catalog" );
+
+        catalogProperties.setProperty( "remote-catalog.repository",
             new File( getBasedir(), "target/test-classes/repositories/central" 
)
-            .toURI().toURL().toExternalForm());
+                .toURI().toURL().toExternalForm() );
+
         List archetypes = archetype.getAvailableArchetypes( catalogProperties 
);
-System.err.println("archetypes => "+archetypes);
+
+        System.err.println( "archetypes => " + archetypes );
         // Here I am just grabbing a OldArchetype but in a UI you would take 
the OldArchetype objects and present
         // them to the user.
 
-        org.apache.maven.archetype.catalog.Archetype selection = 
(org.apache.maven.archetype.catalog.Archetype) archetypes.get( 
archetypes.size() -1 );
-System.err.println("Selected OldArchetype = "+selection);
+        org.apache.maven.archetype.catalog.Archetype selection = 
(org.apache.maven.archetype.catalog.Archetype) archetypes.get( 
archetypes.size() - 1 );
+
+        System.err.println( "Selected OldArchetype = " + selection );
         // Now you will present a dialog, or whatever, and grab the following 
values.
 
         String groupId = "com.mycompany";
@@ -82,22 +87,23 @@
             .setPackage( packageName );
 
         Properties archetypeRequiredProperties = new Properties();
-        archetypeRequiredProperties.setProperty("property-with-default-1", 
"value-1");
-        archetypeRequiredProperties.setProperty("property-with-default-2", 
"value-2");
-        archetypeRequiredProperties.setProperty("property-with-default-3", 
"value-3");
-        archetypeRequiredProperties.setProperty("property-with-default-4", 
"value-4");
-        archetypeRequiredProperties.setProperty("property-without-default-1", 
"some-value-1");
-        archetypeRequiredProperties.setProperty("property-without-default-2", 
"some-value-2");
-        archetypeRequiredProperties.setProperty("property-without-default-3", 
"some-value-3");
-        archetypeRequiredProperties.setProperty("property-without-default-4", 
"some-value-4");
-        agr.setProperties(archetypeRequiredProperties);
+        archetypeRequiredProperties.setProperty( "property-with-default-1", 
"value-1" );
+        archetypeRequiredProperties.setProperty( "property-with-default-2", 
"value-2" );
+        archetypeRequiredProperties.setProperty( "property-with-default-3", 
"value-3" );
+        archetypeRequiredProperties.setProperty( "property-with-default-4", 
"value-4" );
+        archetypeRequiredProperties.setProperty( "property-without-default-1", 
"some-value-1" );
+        archetypeRequiredProperties.setProperty( "property-without-default-2", 
"some-value-2" );
+        archetypeRequiredProperties.setProperty( "property-without-default-3", 
"some-value-3" );
+        archetypeRequiredProperties.setProperty( "property-without-default-4", 
"some-value-4" );
+        agr.setProperties( archetypeRequiredProperties );
 
         // Then generate away!
 
         ArchetypeGenerationResult result = 
archetype.generateProjectFromArchetype( agr );
 
         if ( result.getCause() != null )
-        {result.getCause().printStackTrace(System.err);
+        {
+            result.getCause().printStackTrace( System.err );
             fail( result.getCause().getMessage() );
         }
     }

Modified: 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/repositories/central/archetype-catalog.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/repositories/central/archetype-catalog.xml?rev=596178&r1=596177&r2=596178&view=diff
==============================================================================
--- 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/repositories/central/archetype-catalog.xml
 (original)
+++ 
maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/repositories/central/archetype-catalog.xml
 Sun Nov 18 18:02:27 2007
@@ -5,6 +5,7 @@
       <artifactId>fileset</artifactId>
       <version>1.0</version>
       <description>Fileset test archetype</description>
+      
<repository>file://${basedir}/target/test-classes/repositories/central</repository>
     </archetype>
   </archetypes>
-</archetype-catalog>
\ No newline at end of file
+</archetype-catalog>


Reply via email to