org.apache.maven.archetype
Class DefaultArchetype

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.archetype.DefaultArchetype
All Implemented Interfaces:
Archetype, org.codehaus.plexus.logging.LogEnabled

public class DefaultArchetype
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements Archetype

Author:
Jason van Zyl

Field Summary
 
Fields inherited from interface org.apache.maven.archetype.Archetype
ROLE
 
Constructor Summary
DefaultArchetype()
           
 
Method Summary
 java.io.File archiveArchetype(java.io.File archetypeDirectory, java.io.File outputDirectory, java.lang.String finalName)
          Creates a jar file for an archetype.
 ArchetypeCreationResult createArchetypeFromProject(ArchetypeCreationRequest request)
          A command to create an OldArchetype from an existing Maven project given the suppled creation request.
 ArchetypeGenerationResult generateProjectFromArchetype(ArchetypeGenerationRequest request)
          A command to generate a Maven project from an OldArchetype given the suppled generation request.
 org.apache.maven.archetype.catalog.ArchetypeCatalog getDefaultLocalCatalog()
          Gives the catalog of archetypes located in $user.home/.m2/repository/archetype-catalog.xml.
 org.apache.maven.archetype.catalog.ArchetypeCatalog getInternalCatalog()
          Gives the catalog of archetypes internal to the plugin.
 org.apache.maven.archetype.catalog.ArchetypeCatalog getLocalCatalog(java.lang.String path)
          Gives the catalog of archetypes located in the given path.
 org.apache.maven.archetype.catalog.ArchetypeCatalog getRemoteCatalog()
          Gives the catalog of archetypes located at http://repo1.maven.org/maven2/archetype-catalog.xml.
 org.apache.maven.archetype.catalog.ArchetypeCatalog getRemoteCatalog(java.lang.String url)
          Gives the catalog of archetypes located at the given url.
 void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype)
           
 void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype, java.lang.String path)
           
 void zip(java.io.File sourceDirectory, java.io.File archive)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultArchetype

public DefaultArchetype()
Method Detail

createArchetypeFromProject

public ArchetypeCreationResult createArchetypeFromProject(ArchetypeCreationRequest request)
Description copied from interface: Archetype
A command to create an OldArchetype from an existing Maven project given the suppled creation request.

Specified by:
createArchetypeFromProject in interface Archetype
Returns:
The result of creating the archetype from the existing project. It contains any errors that might have occured.

generateProjectFromArchetype

public ArchetypeGenerationResult generateProjectFromArchetype(ArchetypeGenerationRequest request)
Description copied from interface: Archetype
A command to generate a Maven project from an OldArchetype given the suppled generation request.

Specified by:
generateProjectFromArchetype in interface Archetype
Returns:
The result of creating the proejct from the existing archetype. It contains any errors that might have occured.

archiveArchetype

public java.io.File archiveArchetype(java.io.File archetypeDirectory,
                                     java.io.File outputDirectory,
                                     java.lang.String finalName)
                              throws org.apache.maven.artifact.DependencyResolutionRequiredException,
                                     java.io.IOException
Description copied from interface: Archetype
Creates a jar file for an archetype.

Specified by:
archiveArchetype in interface Archetype
Returns:
The File to the generated jar
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
java.io.IOException

zip

public void zip(java.io.File sourceDirectory,
                java.io.File archive)
         throws java.io.IOException
Throws:
java.io.IOException

getInternalCatalog

public org.apache.maven.archetype.catalog.ArchetypeCatalog getInternalCatalog()
Description copied from interface: Archetype
Gives the catalog of archetypes internal to the plugin.

Specified by:
getInternalCatalog in interface Archetype
Returns:
the catalog.

getDefaultLocalCatalog

public org.apache.maven.archetype.catalog.ArchetypeCatalog getDefaultLocalCatalog()
Description copied from interface: Archetype
Gives the catalog of archetypes located in $user.home/.m2/repository/archetype-catalog.xml.

Specified by:
getDefaultLocalCatalog in interface Archetype
Returns:
the catalog.

getLocalCatalog

public org.apache.maven.archetype.catalog.ArchetypeCatalog getLocalCatalog(java.lang.String path)
Description copied from interface: Archetype
Gives 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:
getLocalCatalog in interface Archetype
Parameters:
path - the catalog file path or directory containing the catalog file.
Returns:
the catalog.

getRemoteCatalog

public org.apache.maven.archetype.catalog.ArchetypeCatalog getRemoteCatalog()
Description copied from interface: Archetype
Gives the catalog of archetypes located at http://repo1.maven.org/maven2/archetype-catalog.xml.

Specified by:
getRemoteCatalog in interface Archetype
Returns:
the catalog.

getRemoteCatalog

public org.apache.maven.archetype.catalog.ArchetypeCatalog getRemoteCatalog(java.lang.String url)
Description copied from interface: Archetype
Gives the catalog of archetypes located at the given url. if the url doesn't define a catalog, then 'archetype-catalog.xml' is appended to it for search.

Specified by:
getRemoteCatalog in interface Archetype
Parameters:
url - the catalog url or base url containing the catalog file.
Returns:
the catalog.

updateLocalCatalog

public void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype)
Specified by:
updateLocalCatalog in interface Archetype

updateLocalCatalog

public void updateLocalCatalog(org.apache.maven.archetype.catalog.Archetype archetype,
                               java.lang.String path)
Specified by:
updateLocalCatalog in interface Archetype


Copyright © 2007-2009 Apache Software Foundation. All Rights Reserved.