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 ArchetypeArtifactManagerprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate org.codehaus.plexus.velocity.VelocityComponentFields inherited from interface OldArchetype
ARCHETYPE_DESCRIPTOR, ARCHETYPE_OLD_DESCRIPTOR, ARCHETYPE_POM, ARCHETYPE_RESOURCES, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanaddModuleToParentPom(String artifactId, Reader fileReader, Writer fileWriter) voidcreateArchetype(ArchetypeGenerationRequest request, File archetypeFile) Create a project from an archetype file.voidcreateArchetype(ArchetypeGenerationRequest request, org.apache.maven.artifact.repository.ArtifactRepository archetypeRepository) Download an archetype then create a project from it.protected voidcreateProjectDirectoryStructure(String outputDirectory) private InputStreamgetDescriptorInputStream(ClassLoader archetypeJarLoader) private StringgetOutputDirectory(String outputDirectory, String testResourceDirectory) private InputStreamgetStream(String name, ClassLoader loader) protected voidprocessResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected voidprocessSiteResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected voidprocessSources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, String sourceDirectory) private voidprocessTemplate(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName) protected voidprocessTemplate(String outputDirectory, org.apache.velocity.context.Context context, String template, TemplateDescriptor descriptor, boolean packageInFileName, String packageName, String sourceDirectory) private voidprocessTemplates(File pomFile, String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName, org.apache.maven.model.Model parentModel) protected voidprocessTestResources(String outputDirectory, org.apache.velocity.context.Context context, ArchetypeDescriptor descriptor, String packageName) protected voidprocessTestSources(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:OldArchetypeDownload an archetype then create a project from it.- Specified by:
createArchetypein interfaceOldArchetype- Throws:
UnknownArchetypeArchetypeDescriptorExceptionArchetypeTemplateProcessingExceptionInvalidPackaging
-
createArchetype
public void createArchetype(ArchetypeGenerationRequest request, File archetypeFile) throws ArchetypeDescriptorException, ArchetypeTemplateProcessingException, InvalidPackaging Description copied from interface:OldArchetypeCreate a project from an archetype file.- Specified by:
createArchetypein interfaceOldArchetype- Throws:
ArchetypeDescriptorExceptionArchetypeTemplateProcessingExceptionInvalidPackaging
-
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
-