Class DefaultArchetypeArtifactManager
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.archetype.common.DefaultArchetypeArtifactManager
- All Implemented Interfaces:
ArchetypeArtifactManager
,org.codehaus.plexus.logging.LogEnabled
@Named
@Singleton
public class DefaultArchetypeArtifactManager
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements ArchetypeArtifactManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
exists
(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories, org.eclipse.aether.RepositorySystemSession repositorySystemSession) private File
getArchetype
(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion) private Reader
getArchetypeDescriptorReader
(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.Model
getArchetypePom
(File jar) getArchetypeZipFile
(File archetypeFile) private Reader
getDescriptorReader
(ZipFile zipFile, String descriptor) getFileSetArchetypeDescriptor
(File archetypeFile) getFilesetArchetypeResources
(File archetypeFile) getOldArchetypeDescriptor
(File archetypeFile) private Reader
getOldArchetypeDescriptorReader
(ZipFile zipFile) getPostGenerationScript
(File archetypeFile) Get the archetype file's post-generation script content, read as UTF-8 content.boolean
isFileSetArchetype
(File archetypeFile) private boolean
isFileSetArchetype
(ZipFile zipFile) boolean
isOldArchetype
(File archetypeFile) private boolean
isOldArchetype
(ZipFile zipFile) private ArchetypeDescriptor
loadFileSetArchetypeDescriptor
(ZipFile zipFile) private ArchetypeDescriptor
loadOldArchetypeDescriptor
(ZipFile zipFile) private ZipEntry
searchEntry
(ZipFile zipFile, String searchString) private void
setArchetype
(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, File archetype) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
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:
getArchetypeFile
in interfaceArchetypeArtifactManager
- Throws:
UnknownArchetype
-
getArchetypeJarLoader
- Specified by:
getArchetypeJarLoader
in 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:
getArchetypePom
in interfaceArchetypeArtifactManager
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
UnknownArchetype
IOException
-
getArchetypeZipFile
- Specified by:
getArchetypeZipFile
in interfaceArchetypeArtifactManager
- Throws:
UnknownArchetype
-
isFileSetArchetype
- Specified by:
isFileSetArchetype
in interfaceArchetypeArtifactManager
-
isOldArchetype
- Specified by:
isOldArchetype
in interfaceArchetypeArtifactManager
-
exists
public boolean exists(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories, org.eclipse.aether.RepositorySystemSession repositorySystemSession) - Specified by:
exists
in interfaceArchetypeArtifactManager
-
getPostGenerationScript
Description copied from interface:ArchetypeArtifactManager
Get the archetype file's post-generation script content, read as UTF-8 content.- Specified by:
getPostGenerationScript
in interfaceArchetypeArtifactManager
- Parameters:
archetypeFile
- the archetype file- Returns:
- the archetype file's post-generation script content or
null
if there is no script in the archetype - Throws:
UnknownArchetype
-
getFileSetArchetypeDescriptor
public ArchetypeDescriptor getFileSetArchetypeDescriptor(File archetypeFile) throws UnknownArchetype - Specified by:
getFileSetArchetypeDescriptor
in interfaceArchetypeArtifactManager
- Throws:
UnknownArchetype
-
getFilesetArchetypeResources
- Specified by:
getFilesetArchetypeResources
in interfaceArchetypeArtifactManager
- Throws:
UnknownArchetype
-
getOldArchetypeDescriptor
- Specified by:
getOldArchetypeDescriptor
in 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:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-
loadOldArchetypeDescriptor
private ArchetypeDescriptor loadOldArchetypeDescriptor(ZipFile zipFile) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException - Throws:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-
getArchetypeDescriptorReader
- Throws:
IOException
-
getOldArchetypeDescriptorReader
- Throws:
IOException
-
getDescriptorReader
- Throws:
IOException
-
searchEntry
-