You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2010/08/19 01:07:54 UTC
svn commit: r986978 - in /maven/archetype/trunk: archetype-common/
archetype-common/src/main/mdo/
archetype-plugin/src/main/java/org/apache/maven/archetype/ui/
archetype-plugin/src/test/java/org/apache/maven/archetype/ui/
Author: hboutemy
Date: Wed Aug 18 23:07:53 2010
New Revision: 986978
URL: http://svn.apache.org/viewvc?rev=986978&view=rev
Log:
moved ArchetypeDefinition and ArchetypeConfiguration from archetype-common to maven-archetype-plugin/ui
Added:
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java (with props)
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java (with props)
Removed:
maven/archetype/trunk/archetype-common/src/main/mdo/archetype-common.mdo
Modified:
maven/archetype/trunk/archetype-common/pom.xml
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.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/DefaultArchetypeGenerationQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java
maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector.java
maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryerTest.java
maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectorTest.java
Modified: maven/archetype/trunk/archetype-common/pom.xml
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/pom.xml?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-common/pom.xml (original)
+++ maven/archetype/trunk/archetype-common/pom.xml Wed Aug 18 23:07:53 2010
@@ -196,17 +196,6 @@ under the License.
<outputDirectory>${basedir}/target/generated-site/resources/xsd</outputDirectory>
</configuration>
</execution>
- <execution>
- <id>java-only</id>
- <configuration>
- <models>
- <model>src/main/mdo/archetype-common.mdo</model>
- </models>
- </configuration>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
</executions>
</plugin>
<plugin>
Added: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java?rev=986978&view=auto
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java (added)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java Wed Aug 18 23:07:53 2010
@@ -0,0 +1,190 @@
+package org.apache.maven.archetype.ui;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.maven.archetype.common.Constants;
+import org.codehaus.plexus.util.StringUtils;
+
+public class ArchetypeConfiguration
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String name;
+
+ private String goals;
+
+ private List<String> requiredProperties;
+
+ public void addRequiredProperty( String string )
+ {
+ getRequiredProperties().add( string );
+ }
+
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ public String getGoals()
+ {
+ return goals;
+ }
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public List<String> getRequiredProperties()
+ {
+ if ( requiredProperties == null )
+ {
+ requiredProperties = new ArrayList<String>();
+ }
+
+ return requiredProperties;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void removeRequiredProperty( String string )
+ {
+ getRequiredProperties().remove( string );
+ }
+
+ public void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ public void setGoals( String goals )
+ {
+ this.goals = goals;
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public void setRequiredProperties( List<String> requiredProperties )
+ {
+ this.requiredProperties = requiredProperties;
+ }
+
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ public void reset()
+ {
+ properties.clear();
+ }
+
+ private Properties properties = new Properties();
+
+ public void setProperty( String requiredProperty, String propertyValue )
+ {
+ properties.setProperty( requiredProperty, propertyValue );
+ }
+
+ public String getProperty( String property )
+ {
+ return properties.getProperty( property, null );
+ }
+
+ public Properties getProperties()
+ {
+ return properties;
+ }
+
+ public Properties toProperties()
+ {
+ Properties result = new Properties();
+
+ result.putAll( properties );
+
+ result.setProperty( Constants.ARCHETYPE_GROUP_ID, StringUtils.isNotEmpty( getGroupId() ) ? getGroupId() : "" );
+ result.setProperty( Constants.ARCHETYPE_ARTIFACT_ID,
+ StringUtils.isNotEmpty( getArtifactId() ) ? getArtifactId() : "" );
+ result.setProperty( Constants.ARCHETYPE_VERSION, StringUtils.isNotEmpty( getVersion() ) ? getVersion() : "" );
+ result.setProperty( Constants.ARCHETYPE_POST_GENERATION_GOALS,
+ StringUtils.isNotEmpty( getGoals() ) ? getGoals() : "" );
+
+ return result;
+ }
+
+ public boolean isConfigured()
+ {
+ for ( String requiredProperty : getRequiredProperties() )
+ {
+ if ( StringUtils.isEmpty( properties.getProperty( requiredProperty ) ) )
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public boolean isConfigured( String requiredProperties )
+ {
+ return StringUtils.isNotEmpty( properties.getProperty( requiredProperties ) );
+ }
+
+ private Properties defaultProperties = new Properties();
+
+ public void setDefaultProperty( String requiredProperty, String propertyValue )
+ {
+ defaultProperties.setProperty( requiredProperty, propertyValue );
+ }
+
+ public String getDefaultValue( String requiredProperty )
+ {
+ return defaultProperties.getProperty( requiredProperty, null );
+ }
+
+ public Properties getDefaultValues()
+ {
+ return defaultProperties;
+ }
+}
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeCreationQueryer.java Wed Aug 18 23:07:53 2010
@@ -19,7 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
import org.codehaus.plexus.components.interactivity.PrompterException;
public interface ArchetypeCreationQueryer
Added: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java?rev=986978&view=auto
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java (added)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java Wed Aug 18 23:07:53 2010
@@ -0,0 +1,130 @@
+package org.apache.maven.archetype.ui;
+
+/*
+ * 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.
+ */
+
+import org.codehaus.plexus.util.StringUtils;
+
+public class ArchetypeDefinition
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String name;
+
+ private String repository;
+
+ private String goals;
+
+ public String getArtifactId()
+ {
+ return this.artifactId;
+ }
+
+ public String getGoals()
+ {
+ return this.goals;
+ }
+
+ public String getGroupId()
+ {
+ return this.groupId;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getRepository()
+ {
+ return this.repository;
+ }
+
+ public String getVersion()
+ {
+ return this.version;
+ }
+
+ public void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ public void setGoals( String goals )
+ {
+ this.goals = goals;
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public void setRepository( String repository )
+ {
+ this.repository = repository;
+ }
+
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ public void reset()
+ {
+ setGroupId( null );
+ setArtifactId( null );
+ setVersion( null );
+ }
+
+ public boolean isArtifactDefined()
+ {
+ return StringUtils.isNotEmpty( getArtifactId() );
+ }
+
+ public boolean isDefined()
+ {
+ return isPartiallyDefined() && isVersionDefined();
+ }
+
+ public boolean isGroupDefined()
+ {
+ return StringUtils.isNotEmpty( getGroupId() );
+ }
+
+ public boolean isPartiallyDefined()
+ {
+ return isGroupDefined() && isArtifactDefined();
+ }
+
+ public boolean isVersionDefined()
+ {
+ return StringUtils.isNotEmpty( getVersion() );
+ }
+
+}
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeDefinition.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java Wed Aug 18 23:07:53 2010
@@ -20,8 +20,6 @@ package org.apache.maven.archetype.ui;
*/
import org.apache.maven.project.MavenProject;
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import java.util.Properties;
@@ -29,25 +27,15 @@ public interface ArchetypeFactory
{
String ROLE = ArchetypeFactory.class.getName();
- /**
- */
- ArchetypeConfiguration createArchetypeConfiguration(
- org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor archetypeDescriptor,
+ ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor archetypeDescriptor,
Properties properties );
- /**
- */
- ArchetypeConfiguration createArchetypeConfiguration(
- org.apache.maven.archetype.metadata.ArchetypeDescriptor archetypeDescriptor,
+ ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.metadata.ArchetypeDescriptor archetypeDescriptor,
Properties properties );
- /**
- */
ArchetypeConfiguration createArchetypeConfiguration( MavenProject project, ArchetypeDefinition archetypeDefinition,
Properties properties );
- /**
- */
ArchetypeDefinition createArchetypeDefinition( Properties properties );
void updateArchetypeConfiguration( ArchetypeConfiguration archetypeConfiguration,
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeGenerationQueryer.java Wed Aug 18 23:07:53 2010
@@ -19,7 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
import org.codehaus.plexus.components.interactivity.PrompterException;
public interface ArchetypeGenerationQueryer
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeSelectionQueryer.java Wed Aug 18 23:07:53 2010
@@ -20,7 +20,6 @@ package org.apache.maven.archetype.ui;
*/
import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.codehaus.plexus.components.interactivity.PrompterException;
import java.util.List;
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationConfigurator.java Wed Aug 18 23:07:53 2010
@@ -19,8 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.apache.maven.archetype.common.ArchetypeFilesResolver;
import org.apache.maven.archetype.common.Constants;
import org.apache.maven.archetype.exception.ArchetypeNotConfigured;
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeCreationQueryer.java Wed Aug 18 23:07:53 2010
@@ -19,7 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
import org.apache.maven.archetype.common.Constants;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java Wed Aug 18 23:07:53 2010
@@ -19,8 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.apache.maven.archetype.common.Constants;
import org.apache.maven.archetype.metadata.RequiredProperty;
import org.apache.maven.project.MavenProject;
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=986978&r1=986977&r2=986978&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 Wed Aug 18 23:07:53 2010
@@ -21,8 +21,6 @@ package org.apache.maven.archetype.ui;
import org.apache.maven.archetype.ArchetypeGenerationRequest;
import org.apache.maven.archetype.common.ArchetypeArtifactManager;
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.apache.maven.archetype.common.ArchetypeRegistryManager;
import org.apache.maven.archetype.common.Constants;
import org.apache.maven.archetype.exception.ArchetypeGenerationConfigurationFailure;
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeGenerationQueryer.java Wed Aug 18 23:07:53 2010
@@ -19,7 +19,6 @@ package org.apache.maven.archetype.ui;
* under the License.
*/
-import org.apache.maven.archetype.common.ArchetypeConfiguration;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
Modified: maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryer.java Wed Aug 18 23:07:53 2010
@@ -20,7 +20,6 @@ package org.apache.maven.archetype.ui;
*/
import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
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=986978&r1=986977&r2=986978&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 Wed Aug 18 23:07:53 2010
@@ -22,7 +22,6 @@ package org.apache.maven.archetype.ui;
import org.apache.maven.archetype.ArchetypeGenerationRequest;
import org.apache.maven.archetype.ArchetypeManager;
import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.apache.maven.archetype.exception.ArchetypeNotDefined;
import org.apache.maven.archetype.exception.ArchetypeSelectionFailure;
import org.apache.maven.archetype.exception.UnknownArchetype;
@@ -53,13 +52,12 @@ public class DefaultArchetypeSelector
private ArchetypeSelectionQueryer archetypeSelectionQueryer;
/** @plexus.requirement */
- private ArchetypeManager archetype;
+ private ArchetypeManager archetypeManager;
public void selectArchetype( ArchetypeGenerationRequest request, Boolean interactiveMode, String catalogs )
throws ArchetypeNotDefined, UnknownArchetype, UnknownGroup, IOException, PrompterException,
ArchetypeSelectionFailure
{
- //This should be an internal class
ArchetypeDefinition definition = new ArchetypeDefinition();
definition.setGroupId( request.getArchetypeGroupId() );
@@ -254,15 +252,15 @@ public class DefaultArchetypeSelector
{
if ( "internal".equalsIgnoreCase( catalog ) )
{
- archetypes.put( "internal", archetype.getInternalCatalog().getArchetypes() );
+ archetypes.put( "internal", archetypeManager.getInternalCatalog().getArchetypes() );
}
else if ( "local".equalsIgnoreCase( catalog ) )
{
- archetypes.put( "local", archetype.getDefaultLocalCatalog().getArchetypes() );
+ archetypes.put( "local", archetypeManager.getDefaultLocalCatalog().getArchetypes() );
}
else if ( "remote".equalsIgnoreCase( catalog ) )
{
- List<Archetype> archetypesFromRemote = archetype.getRemoteCatalog().getArchetypes();
+ List<Archetype> archetypesFromRemote = archetypeManager.getRemoteCatalog().getArchetypes();
if ( archetypesFromRemote.size() > 0 )
{
archetypes.put( "remote", archetypesFromRemote );
@@ -270,17 +268,17 @@ public class DefaultArchetypeSelector
else
{
getLogger().warn( "No archetype found in Remote catalog. Defaulting to internal Catalog" );
- archetypes.put( "internal", archetype.getInternalCatalog().getArchetypes() );
+ archetypes.put( "internal", archetypeManager.getInternalCatalog().getArchetypes() );
}
}
else if ( catalog.startsWith( "file://" ) )
{
String path = catalog.substring( 7 );
- archetypes.put( catalog, archetype.getLocalCatalog( path ).getArchetypes() );
+ archetypes.put( catalog, archetypeManager.getLocalCatalog( path ).getArchetypes() );
}
else if ( catalog.startsWith( "http://" ) )
{
- archetypes.put( catalog, archetype.getRemoteCatalog( catalog ).getArchetypes() );
+ archetypes.put( catalog, archetypeManager.getRemoteCatalog( catalog ).getArchetypes() );
}
}
@@ -288,7 +286,7 @@ public class DefaultArchetypeSelector
{
getLogger().info( "No catalog defined. Using internal catalog" );
- archetypes.put( "internal", archetype.getInternalCatalog().getArchetypes() );
+ archetypes.put( "internal", archetypeManager.getInternalCatalog().getArchetypes() );
}
return archetypes;
}
Modified: maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryerTest.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryerTest.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryerTest.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectionQueryerTest.java Wed Aug 18 23:07:53 2010
@@ -20,7 +20,6 @@ package org.apache.maven.archetype.ui;
*/
import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
@@ -50,7 +49,7 @@ public class DefaultArchetypeSelectionQu
public void testDefaultArchetypeInMapOtherSelection()
throws PrompterException
{
- Map map = createDefaultArchetypeCatalog();
+ Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();
MockControl control = MockControl.createControl( Prompter.class );
Prompter prompter = (Prompter) control.getMock();
@@ -77,7 +76,7 @@ public class DefaultArchetypeSelectionQu
public void testDefaultArchetypeInMapDefaultSelection()
throws PrompterException
{
- Map map = createDefaultArchetypeCatalog();
+ Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();
MockControl control = MockControl.createControl( Prompter.class );
Prompter prompter = (Prompter) control.getMock();
@@ -104,7 +103,7 @@ public class DefaultArchetypeSelectionQu
public void testDefaultArchetypeNotInMap()
throws PrompterException
{
- Map map = createDefaultArchetypeCatalog();
+ Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();
MockControl control = MockControl.createControl( Prompter.class );
Prompter prompter = (Prompter) control.getMock();
@@ -131,7 +130,7 @@ public class DefaultArchetypeSelectionQu
public void testNoDefaultArchetype()
throws PrompterException
{
- Map map = createDefaultArchetypeCatalog();
+ Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();
MockControl control = MockControl.createControl( Prompter.class );
Prompter prompter = (Prompter) control.getMock();
@@ -151,9 +150,9 @@ public class DefaultArchetypeSelectionQu
assertEquals( "set-version", archetype.getVersion() );
}
- private static Map createDefaultArchetypeCatalog()
+ private static Map<String, List<Archetype>> createDefaultArchetypeCatalog()
{
- List list = new ArrayList();
+ List<Archetype> list = new ArrayList<Archetype>();
list.add( createArchetype( "set-groupId", "set-artifactId", "set-version" ) );
list.add( createArchetype( "default-groupId", "default-artifactId", "default-version" ) );
return Collections.singletonMap( "internal", list );
Modified: maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectorTest.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectorTest.java?rev=986978&r1=986977&r2=986978&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectorTest.java (original)
+++ maven/archetype/trunk/archetype-plugin/src/test/java/org/apache/maven/archetype/ui/DefaultArchetypeSelectorTest.java Wed Aug 18 23:07:53 2010
@@ -21,7 +21,6 @@ package org.apache.maven.archetype.ui;
import org.apache.maven.archetype.ArchetypeGenerationRequest;
import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.common.ArchetypeDefinition;
import org.apache.maven.archetype.exception.ArchetypeNotDefined;
import org.apache.maven.archetype.exception.ArchetypeSelectionFailure;
import org.apache.maven.archetype.exception.UnknownArchetype;