Package org.apache.maven.archetype.old
Class DefaultOldArchetype
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.archetype.old.DefaultOldArchetype
- All Implemented Interfaces:
OldArchetype
,org.codehaus.plexus.logging.LogEnabled
@Component(role=OldArchetype.class)
public class DefaultOldArchetype
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements OldArchetype
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArchetypeArtifactManager
private static final String
private static final String
private static final String
private static final String
private org.codehaus.plexus.velocity.VelocityComponent
Fields inherited from interface org.apache.maven.archetype.old.OldArchetype
ARCHETYPE_DESCRIPTOR, ARCHETYPE_OLD_DESCRIPTOR, ARCHETYPE_POM, ARCHETYPE_RESOURCES, ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
addModuleToParentPom
(String artifactId, Reader fileReader, Writer fileWriter) void
createArchetype
(ArchetypeGenerationRequest request, File archetypeFile) Create a project from an archetype file.void
createArchetype
(ArchetypeGenerationRequest request, org.apache.maven.artifact.repository.ArtifactRepository archetypeRepository) Download an archetype then create a project from it.protected void
createProjectDirectoryStructure
(String outputDirectory) private InputStream
getDescriptorInputStream
(ClassLoader archetypeJarLoader) private String
getOutputDirectory
(String outputDirectory, String testResourceDirectory) private InputStream
getStream
(String name, ClassLoader loader) protected void
processResources
(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected void
processSiteResources
(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected void
processSources
(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, String sourceDirectory) private void
processTemplate
(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName) protected void
processTemplate
(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName, String sourceDirectory) private void
processTemplates
(File pomFile, String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, org.apache.maven.model.Model parentModel) protected void
processTestResources
(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected void
processTestSources
(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, String testSourceDirectory) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
DEFAULT_TEST_RESOURCE_DIR
- See Also:
-
DEFAULT_TEST_SOURCE_DIR
- See Also:
-
DEFAULT_RESOURCE_DIR
- See Also:
-
DEFAULT_SOURCE_DIR
- See Also:
-
velocity
@Requirement private org.codehaus.plexus.velocity.VelocityComponent velocity -
archetypeArtifactManager
-
-
Constructor Details
-
DefaultOldArchetype
public DefaultOldArchetype()
-
-
Method Details
-
createArchetype
public void createArchetype(ArchetypeGenerationRequest request, org.apache.maven.artifact.repository.ArtifactRepository archetypeRepository) throws UnknownArchetype, ArchetypeDescriptorException, ArchetypeTemplateProcessingException, InvalidPackaging Description copied from interface:OldArchetype
Download an archetype then create a project from it.- Specified by:
createArchetype
in interfaceOldArchetype
- Throws:
UnknownArchetype
ArchetypeDescriptorException
ArchetypeTemplateProcessingException
InvalidPackaging
-
createArchetype
public void createArchetype(ArchetypeGenerationRequest request, File archetypeFile) throws ArchetypeDescriptorException, ArchetypeTemplateProcessingException, InvalidPackaging Description copied from interface:OldArchetype
Create a project from an archetype file.- Specified by:
createArchetype
in interfaceOldArchetype
- Throws:
ArchetypeDescriptorException
ArchetypeTemplateProcessingException
InvalidPackaging
-
getDescriptorInputStream
private InputStream getDescriptorInputStream(ClassLoader archetypeJarLoader) throws ArchetypeDescriptorException - Throws:
ArchetypeDescriptorException
-
addModuleToParentPom
static boolean addModuleToParentPom(String artifactId, Reader fileReader, Writer fileWriter) throws ArchetypeTemplateProcessingException, InvalidPackaging, IOException, ParserConfigurationException, SAXException, TransformerException -
processTemplates
private void processTemplates(File pomFile, String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, org.apache.maven.model.Model parentModel) throws ArchetypeTemplateProcessingException, IOException -
processTemplate
private void processTemplate(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName) throws ArchetypeTemplateProcessingException, IOException -
getOutputDirectory
-
processSources
protected void processSources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, String sourceDirectory) throws ArchetypeTemplateProcessingException, IOException -
processTestSources
protected void processTestSources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, String testSourceDirectory) throws ArchetypeTemplateProcessingException, IOException -
processResources
protected void processResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) throws IOException, ArchetypeTemplateProcessingException -
processTestResources
protected void processTestResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) throws IOException, ArchetypeTemplateProcessingException -
processSiteResources
protected void processSiteResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) throws IOException, ArchetypeTemplateProcessingException -
processTemplate
protected void processTemplate(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName, String sourceDirectory) throws IOException, ArchetypeTemplateProcessingException -
createProjectDirectoryStructure
-
getStream
-