Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Branching

  • Loading branch information...
commit e3b014c472aa543a0aa6b5f2eb3b0a585178b4d7 1 parent e10037d
Raphael Pieroni authored
View
5 archetype-old/pom.xml
@@ -31,6 +31,11 @@ under the License.
<artifactId>archetype-old</artifactId>
<name>Maven Archetype old</name>
<dependencies>
+ <dependency>
+ <groupId>org.apache.maven.artifact</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
View
107 archetypeng-common/pom.xml
@@ -120,6 +120,26 @@
<version>2.0.6</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-repository</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>war</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-proxy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>war</type>
+ <scope>provided</scope>
+ </dependency>
+ <!--dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>servlet-api-2.5</artifactId>
+ <version>6.1.4</version>
+ <scope>provided</scope>
+ </dependency-->
</dependencies>
<build>
@@ -336,6 +356,93 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3.1</version>
+ <dependencies>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>start-repository</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <wait>true</wait>
+ <container>
+ <containerId>tomcat5x</containerId>
+ <home>/home/local/apache-tomcat-5.5.23</home>
+ <systemProperties>
+ <org.apache.maven.archetype.reporitory.directory>${project.basedir}/target/repository</org.apache.maven.archetype.reporitory.directory>
+ </systemProperties>
+ </container>
+ <configuration>
+ <home>${project.basedir}/target/server-repository</home>
+ <properties>
+ <cargo.servlet.port>18881</cargo.servlet.port>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-repository</artifactId>
+ <type>war</type>
+ <properties>
+ <context>/repo</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-proxy</artifactId>
+ <type>war</type>
+ <properties>
+ <context>/</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </execution>
+ <!--execution>
+ <id>start-proxy</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ </container>
+ <configuration>
+ <home>${project.basedir}/target/server-proxy</home>
+ <properties>
+ <cargo.servlet.port>18882</cargo.servlet.port>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-proxy</artifactId>
+ <type>war</type>
+ <properties>
+ <context>/</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </execution-->
+ <execution>
+ <id>stop</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
View
136 archetypeng-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java
@@ -19,18 +19,35 @@
package org.apache.maven.archetype;
+import java.util.ArrayList;
+import java.util.List;
import org.apache.maven.artifact.repository.ArtifactRepository;
-
import java.util.Properties;
import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.wagon.events.TransferListener;
/** @author Jason van Zyl */
public class ArchetypeGenerationRequest
{
+ private boolean offline;
+
+ private boolean interactiveMode;
+
+ private TransferListener transferListener;
+
private String outputDirectory;
private ArtifactRepository localRepository;
+ private Proxy activeProxy;
+
+ private List servers = new ArrayList( );
+
+ private List mirrors = new ArrayList( );
+
// Archetype definition
private String archetypeName;
@@ -53,28 +70,28 @@
private String packageName;
- private Properties properties = new Properties();
+ private Properties properties = new Properties( );
private String remoteRepository;
- public ArchetypeGenerationRequest()
+ public ArchetypeGenerationRequest( )
{
}
public ArchetypeGenerationRequest( Archetype archetype )
{
- this.archetypeGroupId = archetype.getGroupId();
+ this.archetypeGroupId = archetype.getGroupId( );
- this.archetypeArtifactId = archetype.getArtifactId();
+ this.archetypeArtifactId = archetype.getArtifactId( );
- this.archetypeVersion = archetype.getVersion();
+ this.archetypeVersion = archetype.getVersion( );
- this.remoteRepository = archetype.getRepository();
+ this.remoteRepository = archetype.getRepository( );
- this.archetypeRepository = archetype.getRepository();
+ this.archetypeRepository = archetype.getRepository( );
}
- public String getArchetypeGroupId()
+ public String getArchetypeGroupId( )
{
return archetypeGroupId;
}
@@ -86,7 +103,7 @@ public ArchetypeGenerationRequest setArchetypeGroupId( String archetypeGroupId )
return this;
}
- public String getArchetypeArtifactId()
+ public String getArchetypeArtifactId( )
{
return archetypeArtifactId;
}
@@ -98,7 +115,7 @@ public ArchetypeGenerationRequest setArchetypeArtifactId( String archetypeArtifa
return this;
}
- public String getArchetypeVersion()
+ public String getArchetypeVersion( )
{
return archetypeVersion;
}
@@ -110,7 +127,7 @@ public ArchetypeGenerationRequest setArchetypeVersion( String archetypeVersion )
return this;
}
- public String getArchetypeGoals()
+ public String getArchetypeGoals( )
{
return archetypeGoals;
}
@@ -122,7 +139,7 @@ public ArchetypeGenerationRequest setArchetypeGoals( String archetypeGoals )
return this;
}
- public String getArchetypeName()
+ public String getArchetypeName( )
{
return archetypeName;
}
@@ -134,7 +151,7 @@ public ArchetypeGenerationRequest setArchetypeName( String archetypeName )
return this;
}
- public String getArchetypeRepository()
+ public String getArchetypeRepository( )
{
return archetypeRepository;
}
@@ -146,7 +163,7 @@ public ArchetypeGenerationRequest setArchetypeRepository( String archetypeReposi
return this;
}
- public String getArtifactId()
+ public String getArtifactId( )
{
return artifactId;
}
@@ -158,7 +175,7 @@ public ArchetypeGenerationRequest setArtifactId( String artifactId )
return this;
}
- public String getGroupId()
+ public String getGroupId( )
{
return groupId;
}
@@ -170,7 +187,7 @@ public ArchetypeGenerationRequest setGroupId( String groupId )
return this;
}
- public String getVersion()
+ public String getVersion( )
{
return version;
}
@@ -182,7 +199,7 @@ public ArchetypeGenerationRequest setVersion( String version )
return this;
}
- public String getPackage()
+ public String getPackage( )
{
return packageName;
}
@@ -194,7 +211,7 @@ public ArchetypeGenerationRequest setPackage( String packageName )
return this;
}
- public Properties getProperties()
+ public Properties getProperties( )
{
return properties;
}
@@ -206,7 +223,7 @@ public ArchetypeGenerationRequest setProperties( Properties additionalProperties
return this;
}
- public ArtifactRepository getLocalRepository()
+ public ArtifactRepository getLocalRepository( )
{
return localRepository;
}
@@ -218,7 +235,7 @@ public ArchetypeGenerationRequest setLocalRepository( ArtifactRepository localRe
return this;
}
- public String getRemoteRepository()
+ public String getRemoteRepository( )
{
return remoteRepository;
}
@@ -230,8 +247,7 @@ public ArchetypeGenerationRequest setRemoteRepository( String remoteRepository )
return this;
}
-
- public String getOutputDirectory()
+ public String getOutputDirectory( )
{
return outputDirectory;
}
@@ -242,4 +258,76 @@ public ArchetypeGenerationRequest setOutputDirectory( String outputDirectory )
return this;
}
-}
+
+ public boolean isInteractiveMode( )
+ {
+ return interactiveMode;
+ }
+
+ public ArchetypeGenerationRequest setInteractiveMode( boolean interactiveMode )
+ {
+ this.interactiveMode = interactiveMode;
+
+ return this;
+ }
+
+ public boolean isOffline( )
+ {
+ return offline;
+ }
+
+ public ArchetypeGenerationRequest setOffline( boolean offline )
+ {
+ this.offline = offline;
+
+ return this;
+ }
+
+ public TransferListener getTransferListener( )
+ {
+ return transferListener;
+ }
+
+ public ArchetypeGenerationRequest setTransferListener( TransferListener transferListener )
+ {
+ this.transferListener = transferListener;
+
+ return this;
+ }
+
+ public Proxy getActiveProxy( )
+ {
+ return activeProxy;
+ }
+
+ public ArchetypeGenerationRequest setActiveProxy( Proxy activeProxy )
+ {
+ this.activeProxy = activeProxy;
+
+ return this;
+ }
+
+ public ArchetypeGenerationRequest addMirror( Mirror mirror )
+ {
+ mirrors.add( mirror );
+
+ return this;
+ }
+
+ public List getMirrors( )
+ {
+ return mirrors;
+ }
+
+ public ArchetypeGenerationRequest addMirror( Server server )
+ {
+ servers.add( server );
+
+ return this;
+ }
+
+ public List getServers( )
+ {
+ return servers;
+ }
+}
View
50 ...-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java
@@ -62,29 +62,29 @@ public void testCatalogArchetypeDataSink()
assertEquals( "http://magicbunny.com/maven2", a1.getRepository() );
}
- public void testPuttingTheWikiSourceIntoACatalogSink()
- throws Exception
- {
- Writer writer = new StringWriter();
-
- ArchetypeDataSink sink = new CatalogArchetypeDataSink();
-
- Properties p = new Properties();
-
- p.setProperty( WikiArchetypeDataSource.URL, new File( getBasedir(), "test/sources/wiki-source.txt" ).toURI().toURL().toExternalForm() );
-
- sink.putArchetypes( new WikiArchetypeDataSource(), null , writer );
-
- StringReader reader = new StringReader( writer.toString() );
-
- ArchetypeCatalogXpp3Reader catalogReader = new ArchetypeCatalogXpp3Reader();
-
- ArchetypeCatalog catalog = catalogReader.read( reader );
-
- Archetyper archetype = (Archetyper) lookup( Archetyper.ROLE );
-
- int size = archetype.getAvailableArchetypes().size();
-
- assertEquals( size, catalog.getArchetypes().size() );
- }
+// public void testPuttingTheWikiSourceIntoACatalogSink()
+// throws Exception
+// {
+// Writer writer = new StringWriter();
+//
+// ArchetypeDataSink sink = new CatalogArchetypeDataSink();
+//
+// Properties p = new Properties();
+//
+// p.setProperty( WikiArchetypeDataSource.URL, new File( getBasedir(), "test/sources/wiki-source.txt" ).toURI().toURL().toExternalForm() );
+//
+// sink.putArchetypes( new WikiArchetypeDataSource(), null , writer );
+//
+// StringReader reader = new StringReader( writer.toString() );
+//
+// ArchetypeCatalogXpp3Reader catalogReader = new ArchetypeCatalogXpp3Reader();
+//
+// ArchetypeCatalog catalog = catalogReader.read( reader );
+//
+// Archetyper archetype = (Archetyper) lookup( Archetyper.ROLE );
+//
+// int size = archetype.getAvailableArchetypes().size();
+//
+// assertEquals( size, catalog.getArchetypes().size() );
+// }
}
Please sign in to comment.
Something went wrong with that request. Please try again.