/** FileSetArchetype */ private void processFileSetArchetype(final ArchetypeGenerationRequest request, ArtifactRepository remoteRepo, final ArtifactRepository localRepository, final String basedir, final List<ArtifactRepository> repositories) throws Exception { // TODO: get rid of the property file usage. // Properties properties = request.getProperties(); // // properties.setProperty( Constants.ARCHETYPE_GROUP_ID, request.getArchetypeGroupId() ); // // properties.setProperty( Constants.ARCHETYPE_ARTIFACT_ID, request.getArchetypeArtifactId() // ); // // properties.setProperty( Constants.ARCHETYPE_VERSION, request.getArchetypeVersion() ); // // properties.setProperty( Constants.GROUP_ID, request.getGroupId( ) ); // // properties.setProperty( Constants.ARTIFACT_ID, request.getArtifactId( ) ); // // properties.setProperty( Constants.VERSION, request.getVersion() ); // // properties.setProperty( Constants.PACKAGE, request.getPackage( ) ); // // properties.setProperty( Constants.ARCHETYPE_POST_GENERATION_GOALS, // request.getArchetypeGoals() ); File archetypeFile=archetypeArtifactManager.getArchetypeFile(request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repositories); filesetGenerator.generateArchetype(request, archetypeFile, basedir); }
archetype = archetypeArtifactManager.getArchetypeFile( archetypeGroupId, archetypeArtifactId, archetypeVersion, archetypeRepository, localRepository, remoteRepositories );
public void createArchetype( ArchetypeGenerationRequest request, ArtifactRepository archetypeRepository ) throws UnknownArchetype, ArchetypeNotFoundException, ArchetypeDescriptorException, ArchetypeTemplateProcessingException { // ---------------------------------------------------------------------- // Download the archetype // ---------------------------------------------------------------------- File archetypeFile = archetypeArtifactManager.getArchetypeFile( request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), archetypeRepository, request.getLocalRepository(), request.getRemoteArtifactRepositories(), request.getProjectBuildingRequest() ); createArchetype( request, archetypeFile ); }
private File getArchetypeFile( ArchetypeGenerationRequest request, ArtifactRepository localRepository ) throws IOException, ArchetypeException, XmlPullParserException, DocumentException { if ( !isArchetypeDefined( request ) ) { throw new ArchetypeNotDefined( "The archetype is not defined" ); } List<ArtifactRepository> repos = new ArrayList<ArtifactRepository>(); ArtifactRepository remoteRepo = null; if ( request != null && request.getArchetypeRepository() != null ) { remoteRepo = createRepository( request.getArchetypeRepository(), request.getArchetypeArtifactId() + "-repo" ); repos.add( remoteRepo ); } if ( !archetypeArtifactManager.exists( request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repos, request.getProjectBuildingRequest() ) ) { throw new UnknownArchetype( "The desired archetype does not exist (" + request.getArchetypeGroupId() + ":" + request.getArchetypeArtifactId() + ":" + request.getArchetypeVersion() + ")" ); } File archetypeFile = archetypeArtifactManager.getArchetypeFile( request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repos, request.getProjectBuildingRequest() ); return archetypeFile; }