public ArchetypeGenerationResult generateProjectFromArchetype(ArchetypeGenerationRequest request) { ArchetypeGenerationResult result = new ArchetypeGenerationResult(); generator.generateArchetype(request, result); return result; }
public ArchetypeGenerationResult generateProjectFromArchetype( ArchetypeGenerationRequest request ) { ArchetypeGenerationResult result = new ArchetypeGenerationResult(); generator.generateArchetype( request, result ); return result; }
private ArchetypeGenerationRequest generate( String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, File archetypeFile, Properties properties, String basedir ) throws IntegrationTestFailure { //@formatter:off ArchetypeGenerationRequest request = new ArchetypeGenerationRequest().setArchetypeGroupId( archetypeGroupId ).setArchetypeArtifactId( archetypeArtifactId ).setArchetypeVersion( archetypeVersion ).setGroupId( properties.getProperty( Constants.GROUP_ID ) ).setArtifactId( properties.getProperty( Constants.ARTIFACT_ID ) ).setVersion( properties.getProperty( Constants.VERSION ) ).setPackage( properties.getProperty( Constants.PACKAGE ) ).setOutputDirectory( basedir ).setProperties( properties ); //@formatter:on ArchetypeGenerationResult result = new ArchetypeGenerationResult(); archetypeGenerator.generateArchetype( request, archetypeFile, result ); if ( result.getCause() != null ) { if ( result.getCause() instanceof ArchetypeNotConfigured ) { ArchetypeNotConfigured anc = (ArchetypeNotConfigured) result.getCause(); throw new IntegrationTestFailure( "Missing required properties in archetype.properties: " + StringUtils.join( anc.getMissingProperties().iterator(), ", " ), anc ); } throw new IntegrationTestFailure( result.getCause().getMessage(), result.getCause() ); } return request; }
private ArchetypeGenerationRequest generate( String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, File archetypeFile, Properties properties, String basedir ) throws IntegrationTestFailure { //@formatter:off ArchetypeGenerationRequest request = new ArchetypeGenerationRequest().setArchetypeGroupId( archetypeGroupId ).setArchetypeArtifactId( archetypeArtifactId ).setArchetypeVersion( archetypeVersion ).setGroupId( properties.getProperty( Constants.GROUP_ID ) ).setArtifactId( properties.getProperty( Constants.ARTIFACT_ID ) ).setVersion( properties.getProperty( Constants.VERSION ) ).setPackage( properties.getProperty( Constants.PACKAGE ) ).setOutputDirectory( basedir ).setProperties( properties ); //@formatter:on ArchetypeGenerationResult result = new ArchetypeGenerationResult(); archetypeGenerator.generateArchetype( request, archetypeFile, result ); if ( result.getCause() != null ) { if ( result.getCause() instanceof ArchetypeNotConfigured ) { ArchetypeNotConfigured anc = (ArchetypeNotConfigured) result.getCause(); throw new IntegrationTestFailure( "Missing required properties in archetype.properties: " + StringUtils.join( anc.getMissingProperties().iterator(), ", " ), anc ); } throw new IntegrationTestFailure( result.getCause().getMessage(), result.getCause() ); } return request; }