You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ra...@apache.org on 2007/11/20 23:31:07 UTC
svn commit: r596854 [2/2] - in /maven/sandbox/trunk/archetypeng: ./
archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/
archetype-testing/archetype-proxy/src/main/webapp/WEB-INF/
archetype-testing/archetype-repository/src/...
Added: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/pom.xml?rev=596854&view=auto
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/pom.xml (added)
+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/pom.xml Tue Nov 20 14:31:04 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.test</groupId>
+ <artifactId>test-project-2</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>test-project-2</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/main/java/org/apache/maven/test/App.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/main/java/org/apache/maven/test/App.java?rev=596854&view=auto
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/main/java/org/apache/maven/test/App.java (added)
+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/main/java/org/apache/maven/test/App.java Tue Nov 20 14:31:04 2007
@@ -0,0 +1,13 @@
+package projects.roundtrip-1-project_1.src.main.java.org.apache.maven.test;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/main/java/org/apache/maven/test/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/test/java/org/apache/maven/test/AppTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/test/java/org/apache/maven/test/AppTest.java?rev=596854&view=auto
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/test/java/org/apache/maven/test/AppTest.java (added)
+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/test/java/org/apache/maven/test/AppTest.java Tue Nov 20 14:31:04 2007
@@ -0,0 +1,38 @@
+package projects.roundtrip-1-project_1.src.test.java.org.apache.maven.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/resources/projects/roundtrip-2-project/src/test/java/org/apache/maven/test/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java?rev=596854&r1=596853&r2=596854&view=diff
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java (original)
+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationConfigurator.java Tue Nov 20 14:31:04 2007
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.maven.archetype.ui;
+
import org.apache.maven.archetype.old.OldArchetype;
import org.apache.maven.archetype.ArchetypeGenerationRequest;
import org.apache.maven.archetype.common.ArchetypeArtifactManager;
@@ -74,6 +74,8 @@
{
ArtifactRepository localRepository = request.getLocalRepository();
+ ArtifactRepository archetypeRepository = null;
+
List repositories = new ArrayList();
Properties properties = new Properties( executionProperties );
@@ -90,40 +92,47 @@
{
throw new ArchetypeNotDefined( "The archetype is not defined" );
}
-
- if ( request.getRemoteRepository() != null )
- {
- repositories.add( archetypeRegistryManager.createRepository( request.getRemoteRepository(), ad.getArtifactId() + "-repo" ) );
+ if ( request.getRemoteRepository() != null )
+ {
+ archetypeRepository = archetypeRegistryManager.createRepository( request.getRemoteRepository(),
+ ad.getArtifactId() + "-repo" );
+ repositories.add( archetypeRepository );
}
- if ( !archetypeArtifactManager.exists( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), localRepository, repositories ) )
+ if ( !archetypeArtifactManager.exists( ad.getGroupId(), ad.getArtifactId(),
+ ad.getVersion(), archetypeRepository, localRepository, repositories ) )
{
throw new UnknownArchetype(
- "The desired archetype does not exist (" + ad.getGroupId() + ":"
- + ad.getArtifactId() + ":" + ad.getVersion()
- + ")"
- );
+ "The desired archetype does not exist (" + ad.getGroupId() + ":" + ad.getArtifactId() + ":" + ad.getVersion() + ")" );
}
request.setArchetypeVersion( ad.getVersion() );
ArchetypeConfiguration archetypeConfiguration;
- if ( archetypeArtifactManager.isFileSetArchetype( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), localRepository, repositories ) )
+ if ( archetypeArtifactManager.isFileSetArchetype( ad.getGroupId(),
+ ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository,
+ repositories ) )
{
org.apache.maven.archetype.metadata.ArchetypeDescriptor archetypeDescriptor =
- archetypeArtifactManager.getFileSetArchetypeDescriptor( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), localRepository,
- repositories );
-
- archetypeConfiguration = archetypeFactory.createArchetypeConfiguration( archetypeDescriptor, properties );
- }
- else if ( archetypeArtifactManager.isOldArchetype( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), localRepository, repositories ) )
+ archetypeArtifactManager.getFileSetArchetypeDescriptor( ad.getGroupId(),
+ ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository,
+ repositories );
+
+ archetypeConfiguration = archetypeFactory.createArchetypeConfiguration( archetypeDescriptor,
+ properties );
+ }
+ else if ( archetypeArtifactManager.isOldArchetype( ad.getGroupId(),
+ ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository,
+ repositories ) )
{
org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor archetypeDescriptor =
- archetypeArtifactManager.getOldArchetypeDescriptor( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), localRepository,
- repositories );
+ archetypeArtifactManager.getOldArchetypeDescriptor( ad.getGroupId(),
+ ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository,
+ repositories );
- archetypeConfiguration = archetypeFactory.createArchetypeConfiguration( archetypeDescriptor, properties );
+ archetypeConfiguration = archetypeFactory.createArchetypeConfiguration( archetypeDescriptor,
+ properties );
}
else
{
@@ -138,7 +147,8 @@
{
if ( !archetypeConfiguration.isConfigured() )
{
- Iterator requiredProperties = archetypeConfiguration.getRequiredProperties().iterator();
+ Iterator requiredProperties = archetypeConfiguration.getRequiredProperties().
+ iterator();
while ( requiredProperties.hasNext() )
{
@@ -148,15 +158,14 @@
{
archetypeConfiguration.setProperty( requiredProperty,
archetypeGenerationQueryer.getPropertyValue( requiredProperty,
- archetypeConfiguration.getDefaultValue( requiredProperty ) ) );
+ archetypeConfiguration.getDefaultValue( requiredProperty ) ) );
}
}
}
if ( !archetypeConfiguration.isConfigured() )
{
throw new ArchetypeGenerationConfigurationFailure(
- "The archetype generation must be configured here"
- );
+ "The archetype generation must be configured here" );
}
else if ( !archetypeGenerationQueryer.confirmConfiguration( archetypeConfiguration ) )
{
@@ -178,7 +187,7 @@
throw new ArchetypeNotConfigured( "The archetype is not configurated" );
}
}
-
+
request.setGroupId( archetypeConfiguration.getProperty( Constants.GROUP_ID ) );
request.setArtifactId( archetypeConfiguration.getProperty( Constants.ARTIFACT_ID ) );
@@ -188,7 +197,7 @@
request.setPackage( archetypeConfiguration.getProperty( Constants.PACKAGE ) );
properties = archetypeConfiguration.getProperties();
-
+
properties.remove( Constants.GROUP_ID );
properties.remove( Constants.ARTIFACT_ID );
@@ -196,7 +205,7 @@
properties.remove( Constants.VERSION );
properties.remove( Constants.PACKAGE );
-
+
request.setProperties( properties );
}
}
Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java?rev=596854&r1=596853&r2=596854&view=diff
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java (original)
+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java Tue Nov 20 14:31:04 2007
@@ -111,7 +111,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/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/pom.xml?rev=596854&r1=596853&r2=596854&view=diff
==============================================================================
--- maven/sandbox/trunk/archetypeng/pom.xml (original)
+++ maven/sandbox/trunk/archetypeng/pom.xml Tue Nov 20 14:31:04 2007
@@ -17,9 +17,8 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -46,6 +45,7 @@
<properties>
<mavenVersion>2.1-SNAPSHOT</mavenVersion>
+ <netbeans.hint.useExternalMaven>true</netbeans.hint.useExternalMaven>
</properties>
<licenses>
@@ -196,21 +196,21 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<reportSets>
- <reportSet></reportSet>
+ <reportSet />
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<reportSets>
- <reportSet></reportSet>
+ <reportSet />
</reportSets>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<reportSets>
- <reportSet></reportSet>
+ <reportSet />
</reportSets>
</plugin>
<plugin>
@@ -241,14 +241,14 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<reportSets>
- <reportSet></reportSet>
+ <reportSet />
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<reportSets>
- <reportSet></reportSet>
+ <reportSet />
</reportSets>
</plugin>
</plugins>
@@ -274,8 +274,7 @@
<excludes>
<exclude>**/testdata/**</exclude>
</excludes>
- <environment>
- </environment>
+ <environment></environment>
</configuration>
<executions>
<execution>