compose: jvanzylDate: Sun Sep 30 20:25:00 2007New Revision: 580825URL: Log:o remove the properties file after creation of a project from an archetype go away removing the use of the propertiesModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaModified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/common/Constants java Sun Sep 30 20:25:00 2007@@ -30,6 +30,8 @@ String ARCHETYPE_VERSION = "archetype version"; + String ARCHETYPE_REPOSITORY = "archetype repository";+ String ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype-metadata xml"; arrange ARCHETYPE_POST_GENERATION_GOALS = "archetype goals";Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo javaURL: ==============================================================================--- maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java (original)+++ maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateProjectFromArchetypeMojo java Sun Sep 30 20:25:00 2007@@ -19,12 +19,11 @@ package org apache maven archetype mojos; -import org apache maven archetype common. ArchetypeDefinition; merchandise org apache maven archetype common. ArchetypePropertiesManager; merchandise org apache maven archetype common. ArchetypeRegistryManager; import org apache maven archetype common. Constants;-import org apache maven archetype ui. ArchetypeGenerationConfigurator; merchandise org apache maven archetype generator. ArchetypeGenerator;+import org apache maven archetype ui. ArchetypeGenerationConfigurator; import org apache maven archetype ui. ArchetypeSelector; import org apache maven artifact repository. ArtifactRepository; merchandise org apache maven plugin. AbstractMojo;@@ -36,10 +35,12 @@ import org apache maven shared invoker. InvocationRequest; merchandise org apache maven shared invoker. Invoker; import org apache maven shared invoker. MavenInvocationException;+import org codehaus plexus util. FileUtils; import org codehaus plexus util. PropertyUtils; merchandise org codehaus plexus util. StringUtils; merchandise java io. File;+import java io. IOException; import java util. Arrays; import java util. enumerate; merchandise java util. Properties;@@ -202,13 +203,6 @@ ); generator generateArchetype( propertyFile localRepository repositories basedir getAbsolutePath() );-- Properties archetypeProperties = PropertyUtils loadProperties( propertyFile );-- if ( archetypeProperties != null )- {- getPluginContext() put( "artifactId" archetypeProperties getProperty( "artifactId" ) );- } } surprise ( Exception ex ) {@@ -221,38 +215,31 @@ // run some goals that the archetype creator has requested to be run once the project // has been created. - String postArchetypeGenerationGoals;+ Properties properties = PropertyUtils loadProperties( propertyFile ); - Properties p = new Properties();+ String artifactId = properties getProperty( "artifactId" ); - try- {- propertiesManager readProperties( p new register( basedir. "archetype properties" ) );+ String postArchetypeGenerationGoals = properties getProperty( Constants. ARCHETYPE_POST_GENERATION_GOALS ); - postArchetypeGenerationGoals = p getProperty( Constants. ARCHETYPE_POST_GENERATION_GOALS );- }- surprise ( Exception e )+ if ( StringUtils isEmpty( postArchetypeGenerationGoals ) ) { postArchetypeGenerationGoals = goals; } if ( StringUtils isNotEmpty( postArchetypeGenerationGoals ) ) {- invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals );+ invokePostArchetypeGenerationGoals( postArchetypeGenerationGoals artifactId ); }- } + FileUtils fileDelete( propertyFile getAbsolutePath() );+ } - private void invokePostArchetypeGenerationGoals( String goals )+ private void invokePostArchetypeGenerationGoals( String goals. String artifactId ) throws MojoExecutionException. MojoFailureException {- //TODO update the archetype descriptor to deliver goals and properties- //TODO probably write out the properties to a file for now- //TODO remove the properties files when the execution is complete-- File projectBasedir = new File( basedir. (arrange) getPluginContext() get( "artifactId" ) );+ register projectBasedir = new File( basedir artifactId ); if ( projectBasedir exists() ) {Modified: maven/sandbox/trunk/archetypeng/archetypeng-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeSelector javaURL: ==============================================================================--- 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 Sun Sep 30 20:25:00 2007@@ -228,6 +228,11 @@ (org codehaus plexus util. StringUtils isNotEmpty( ad getGoals() ) ? ad getGoals() : "" ) ); + properties setProperty (+ Constants. ARCHETYPE_REPOSITORY,+ (org codehaus plexus util. StringUtils isNotEmpty( ad getRepository() ) ? ad getRepository() : "" )+ );+ go properties; }
Forex Groups - Tips on Trading
Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=12972856&framed=y&skin=177
comments | Add comment | Report as Spam
|