private void checkArchetypeFile( File jarFile ) throws MojoExecutionException { try { if ( archetypeArtifactManager.isFileSetArchetype( jarFile ) ) { checkFileSetArchetypeFile( jarFile ); } else if ( archetypeArtifactManager.isOldArchetype( jarFile ) ) { getLog().warn( "Building an Old (1.x) Archetype: consider migrating it to current 2.x Archetype." ); } else { throw new MojoExecutionException( "The current project does not build an archetype" ); } } catch ( UnknownArchetype ua ) { throw new MojoExecutionException( ua.getMessage(), ua ); } }
private void checkArchetypeFile( File jarFile ) throws MojoExecutionException { try { if ( archetypeArtifactManager.isFileSetArchetype( jarFile ) ) { checkFileSetArchetypeFile( jarFile ); } else if ( archetypeArtifactManager.isOldArchetype( jarFile ) ) { getLog().warn( "Building an Old (1.x) Archetype: consider migrating it to current 2.x Archetype." ); } else { throw new MojoExecutionException( "The current project does not build an archetype" ); } } catch ( UnknownArchetype ua ) { throw new MojoExecutionException( ua.getMessage(), ua ); } }
private void generateArchetype( ArchetypeGenerationRequest request, File archetypeFile ) throws IOException, ArchetypeException, XmlPullParserException, DocumentException { if ( archetypeArtifactManager.isFileSetArchetype( archetypeFile ) ) { processFileSetArchetype( request, archetypeFile ); } else if ( archetypeArtifactManager.isOldArchetype( archetypeFile ) ) { processOldArchetype( request, archetypeFile ); } else { throw new ArchetypeGenerationFailure( "The defined artifact is not an archetype" ); } }
File jar=(File) jars.next(); log.info("Scanning " + jar); if (archetypeArtifactManager.isFileSetArchetype(jar) || archetypeArtifactManager.isOldArchetype(jar)) { try { Archetype archetype=new Archetype();
if ( archetypeArtifactManager.isFileSetArchetype( jar ) || archetypeArtifactManager.isOldArchetype( jar ) )
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(), archetypeRepository, localRepository, repositories);
private void generateArchetype(ArchetypeGenerationRequest request, ArtifactRepository localRepository, String basedir) throws Exception { assert request != null; if (!isArchetypeDefined(request)) { throw new ArchetypeNotDefined("The archetype is not defined"); } List<ArtifactRepository> repos=new ArrayList<ArtifactRepository>(); ArtifactRepository remoteRepo=null; if (request.getArchetypeRepository() != null) { remoteRepo=archetypeRegistryManager.createRepository(request.getArchetypeRepository(), request.getArchetypeArtifactId() + "-repo"); repos.add(remoteRepo); } if (!archetypeArtifactManager.exists(request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repos)) { throw new UnknownArchetype("The desired archetype does not exist (" + request.getArchetypeGroupId() + ":" + request.getArchetypeArtifactId() + ":" + request.getArchetypeVersion() + ")"); } if (archetypeArtifactManager.isFileSetArchetype(request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repos)) { processFileSetArchetype(request, remoteRepo, localRepository, basedir, repos); } else if (archetypeArtifactManager.isOldArchetype(request.getArchetypeGroupId(), request.getArchetypeArtifactId(), request.getArchetypeVersion(), remoteRepo, localRepository, repos)) { processOldArchetype(request, remoteRepo, localRepository, basedir, repos); } else { throw new ArchetypeGenerationFailure("The defined artifact is not an archetype"); } }
else if ( archetypeArtifactManager.isOldArchetype( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository, repositories, request.getProjectBuildingRequest() ) )
else if ( archetypeArtifactManager.isOldArchetype( ad.getGroupId(), ad.getArtifactId(), ad.getVersion(), archetypeRepository, localRepository, repositories, request.getProjectBuildingRequest() ) )