Class DefaultOldArchetype
java.lang.Object
org.apache.maven.archetype.old.DefaultOldArchetype
- All Implemented Interfaces:
OldArchetype
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArchetypeArtifactManagerprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final org.slf4j.Loggerprivate org.codehaus.plexus.velocity.VelocityComponentFields inherited from interface OldArchetype
ARCHETYPE_DESCRIPTOR, ARCHETYPE_OLD_DESCRIPTOR, ARCHETYPE_POM, ARCHETYPE_RESOURCES, ROLE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOldArchetype(org.codehaus.plexus.velocity.VelocityComponent velocity, ArchetypeArtifactManager archetypeArtifactManager) -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanaddModuleToParentPom(String artifactId, Reader fileReader, Writer fileWriter) voidDownload an archetype then create a project from it.voidcreateArchetype(ArchetypeGenerationRequest request, File archetypeFile) Create a project from an archetype file.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)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULT_TEST_RESOURCE_DIR
- See Also:
-
DEFAULT_TEST_SOURCE_DIR
- See Also:
-
DEFAULT_RESOURCE_DIR
- See Also:
-
DEFAULT_SOURCE_DIR
- See Also:
-
velocity
private org.codehaus.plexus.velocity.VelocityComponent velocity -
archetypeArtifactManager
-
-
Constructor Details
-
DefaultOldArchetype
@Inject public DefaultOldArchetype(org.codehaus.plexus.velocity.VelocityComponent velocity, ArchetypeArtifactManager archetypeArtifactManager)
-
-
Method Details
-
createArchetype
public void createArchetype(ArchetypeGenerationRequest request) 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
-