Class DefaultArchetypeArtifactManager
java.lang.Object
org.apache.maven.archetype.common.DefaultArchetypeArtifactManager
- All Implemented Interfaces:
ArchetypeArtifactManager
@Named
@Singleton
public class DefaultArchetypeArtifactManager
extends Object
implements ArchetypeArtifactManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Downloaderprivate static final org.slf4j.Loggerprivate PomManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories, org.eclipse.aether.RepositorySystemSession repositorySystemSession) private FilegetArchetype(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion) private ReadergetArchetypeDescriptorReader(ZipFile zipFile) getArchetypeFile(String groupId, String artifactId, String version, List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession repositorySystemSession) getArchetypeJarLoader(File archetypeFile) org.apache.maven.model.ModelgetArchetypePom(File jar) getArchetypeZipFile(File archetypeFile) private ReadergetDescriptorReader(ZipFile zipFile, String descriptor) getFileSetArchetypeDescriptor(File archetypeFile) getFilesetArchetypeResources(File archetypeFile) getOldArchetypeDescriptor(File archetypeFile) private ReadergetOldArchetypeDescriptorReader(ZipFile zipFile) getPostGenerationScript(File archetypeFile) Get the archetype file's post-generation script content, read as UTF-8 content.booleanisFileSetArchetype(File archetypeFile) private booleanisFileSetArchetype(ZipFile zipFile) booleanisOldArchetype(File archetypeFile) private booleanisOldArchetype(ZipFile zipFile) private ArchetypeDescriptorloadFileSetArchetypeDescriptor(ZipFile zipFile) private ArchetypeDescriptorloadOldArchetypeDescriptor(ZipFile zipFile) private ZipEntrysearchEntry(ZipFile zipFile, String searchString) private voidsetArchetype(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, File archetype)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
downloader
-
pomManager
-
archetypeCache
-
-
Constructor Details
-
DefaultArchetypeArtifactManager
public DefaultArchetypeArtifactManager()
-
-
Method Details
-
getArchetypeFile
public File getArchetypeFile(String groupId, String artifactId, String version, List<org.eclipse.aether.repository.RemoteRepository> repositories, org.eclipse.aether.RepositorySystemSession repositorySystemSession) throws UnknownArchetype - Specified by:
getArchetypeFilein interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
getArchetypeJarLoader
- Specified by:
getArchetypeJarLoaderin interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
getArchetypePom
public org.apache.maven.model.Model getArchetypePom(File jar) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, UnknownArchetype, IOException - Specified by:
getArchetypePomin interfaceArchetypeArtifactManager- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionUnknownArchetypeIOException
-
getArchetypeZipFile
- Specified by:
getArchetypeZipFilein interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
isFileSetArchetype
- Specified by:
isFileSetArchetypein interfaceArchetypeArtifactManager
-
isOldArchetype
- Specified by:
isOldArchetypein interfaceArchetypeArtifactManager
-
exists
-
getPostGenerationScript
Description copied from interface:ArchetypeArtifactManagerGet the archetype file's post-generation script content, read as UTF-8 content.- Specified by:
getPostGenerationScriptin interfaceArchetypeArtifactManager- Parameters:
archetypeFile- the archetype file- Returns:
- the archetype file's post-generation script content or
nullif there is no script in the archetype - Throws:
UnknownArchetype
-
getFileSetArchetypeDescriptor
public ArchetypeDescriptor getFileSetArchetypeDescriptor(File archetypeFile) throws UnknownArchetype - Specified by:
getFileSetArchetypeDescriptorin interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
getFilesetArchetypeResources
- Specified by:
getFilesetArchetypeResourcesin interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
getOldArchetypeDescriptor
- Specified by:
getOldArchetypeDescriptorin interfaceArchetypeArtifactManager- Throws:
UnknownArchetype
-
getArchetype
-
setArchetype
-
isFileSetArchetype
- Throws:
IOException
-
isOldArchetype
- Throws:
IOException
-
loadFileSetArchetypeDescriptor
private ArchetypeDescriptor loadFileSetArchetypeDescriptor(ZipFile zipFile) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserException
-
loadOldArchetypeDescriptor
private ArchetypeDescriptor loadOldArchetypeDescriptor(ZipFile zipFile) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOExceptionorg.codehaus.plexus.util.xml.pull.XmlPullParserException
-
getArchetypeDescriptorReader
- Throws:
IOException
-
getOldArchetypeDescriptorReader
- Throws:
IOException
-
getDescriptorReader
- Throws:
IOException
-
searchEntry
-