Class DefaultArchetypeManager
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.archetype.DefaultArchetypeManager
- All Implemented Interfaces:
ArchetypeManager, org.codehaus.plexus.logging.LogEnabled
@Component(role=ArchetypeManager.class)
public class DefaultArchetypeManager
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements ArchetypeManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String, ArchetypeDataSource> private ArchetypeCreatorprivate ArchetypeGeneratorFields inherited from interface ArchetypeManager
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarchiveArchetype(File archetypeDirectory, File outputDirectory, String finalName) Creates a jar file for an archetype.A command to create an archetype from an existing Maven project given the supplied creation request.A command to generate a Maven project from an archetype given the supplied generation request.Gives the catalog of archetypes internal to the plugin.getLocalCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) Gives the catalog of archetypes located in the given path.getRemoteCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) Gives the catalog of archetypes located athttps://repo.maven.apache.org/maven2/archetype-catalog.xml.updateLocalCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest, Archetype archetype) voidprivate voidzipper(ZipOutputStream zos, int offset, File currentSourceDirectory) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
creator
-
generator
-
archetypeSources
@Requirement(role=ArchetypeDataSource.class) private Map<String, ArchetypeDataSource> archetypeSources
-
-
Constructor Details
-
DefaultArchetypeManager
public DefaultArchetypeManager()
-
-
Method Details
-
createArchetypeFromProject
Description copied from interface:ArchetypeManagerA command to create an archetype from an existing Maven project given the supplied creation request.- Specified by:
createArchetypeFromProjectin interfaceArchetypeManager- Parameters:
request-- Returns:
- The result of creating the archetype from the existing project. It contains any errors that might have occurred.
-
generateProjectFromArchetype
Description copied from interface:ArchetypeManagerA command to generate a Maven project from an archetype given the supplied generation request.- Specified by:
generateProjectFromArchetypein interfaceArchetypeManager- Parameters:
request-- Returns:
- The result of creating the project from the existing archetype. It contains any errors that might have occurred.
-
archiveArchetype
public File archiveArchetype(File archetypeDirectory, File outputDirectory, String finalName) throws org.apache.maven.artifact.DependencyResolutionRequiredException, IOException Description copied from interface:ArchetypeManagerCreates a jar file for an archetype.- Specified by:
archiveArchetypein interfaceArchetypeManager- Parameters:
archetypeDirectory-outputDirectory-finalName-- Returns:
- The File to the generated jar
- Throws:
org.apache.maven.artifact.DependencyResolutionRequiredExceptionIOException
-
zip
- Throws:
IOException
-
zipper
private void zipper(ZipOutputStream zos, int offset, File currentSourceDirectory) throws IOException - Throws:
IOException
-
getInternalCatalog
Description copied from interface:ArchetypeManagerGives the catalog of archetypes internal to the plugin.- Specified by:
getInternalCatalogin interfaceArchetypeManager- Returns:
- the catalog.
-
getLocalCatalog
public ArchetypeCatalog getLocalCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) Description copied from interface:ArchetypeManagerGives the catalog of archetypes located in the given path. if path is a file, it used as is. if path is a directory, archetype-catalog.xml is appended to it.- Specified by:
getLocalCatalogin interfaceArchetypeManager- Parameters:
buildingRequest- the catalog file path or directory containing the catalog file.- Returns:
- the catalog.
-
getRemoteCatalog
public ArchetypeCatalog getRemoteCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) Description copied from interface:ArchetypeManagerGives the catalog of archetypes located athttps://repo.maven.apache.org/maven2/archetype-catalog.xml.- Specified by:
getRemoteCatalogin interfaceArchetypeManager- Parameters:
buildingRequest- TODO- Returns:
- the catalog.
-
updateLocalCatalog
public File updateLocalCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest, Archetype archetype) - Specified by:
updateLocalCatalogin interfaceArchetypeManager
-