Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Submitted by: Franz Allan See

Added documentation for maven archetype plugin.


git-svn-id: https://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype@425587 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
oching committed Jul 26, 2006
1 parent cc310cb commit a69a339
Show file tree
Hide file tree
Showing 15 changed files with 1,015 additions and 2 deletions.
82 changes: 82 additions & 0 deletions maven-archetype-plugin/pom.xml
Expand Up @@ -9,6 +9,46 @@
<artifactId>maven-archetype-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Archetype Plugin</name>
<description>
The Maven Archetype Plugin builds archetype containers.
</description>
<url>http://maven.apache.org/plugins/maven-archetype-plugin/</url>
<inceptionYear>2001</inceptionYear>
<mailingLists>
<mailingList>
<name>Maven User List</name>
<subscribe>users-subscribe@maven.apache.org</subscribe>
<unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe>
<post>users@maven.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
<name>Maven Developer List</name>
<subscribe>dev-subscribe@maven.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe>
<post>dev@maven.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
</mailingList>
<mailingList>
<name>Maven Commits List</name>
<subscribe>commits-subscribe@maven.apache.org</subscribe>
<unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe>
<post>commits@maven.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
</mailingList>
</mailingLists>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</connection>
<developerConnection>scm:svn:http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</developerConnection>
<url>http://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/</url>
</scm>
<prerequisites>
<maven>2.0</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand All @@ -34,4 +74,46 @@
<artifactId>maven-archetype-creator</artifactId>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.2-SNAPSHOT</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>ciProfile</id>
<activation>
<property>
<name>enableCiProfile</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-docck-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Expand Up @@ -27,7 +27,8 @@
import java.io.FileInputStream;

/**
* Builds archetype containers.
* Builds archetype containers based from an existing Maven project (work in
* progress).
*
* @goal create-from-project
* @description Create an archetype from an existing Maven project.
Expand All @@ -37,24 +38,32 @@ public class CreateArchetypeFromProjectMojo
extends AbstractMojo
{
/**
* The Maven Project to be used as the basis for the creating of the archetype.
*
* @parameter expression="${project}"
* @required
*/
private MavenProject project;

/**
* Maven's local repository.
*
* @parameter expression="${localRepository}"
* @required
*/
private ArtifactRepository localRepository;

/**
* Output build directory.
*
* @parameter expression="${targetDirectory}" default-value="${project.build.directory}"
* @required
*/
private File targetDirectory;

/**
* Maven ArchetypeCreator
*
* @component
*/
private ArchetypeCreator archetypeCreator;
Expand All @@ -68,6 +77,8 @@ public class CreateArchetypeFromProjectMojo


/**
* Contains Archetype Properties.
*
* @parameter expression="${archetypeProperties}" default-value="${basedir}/src/main/archetype/archetype.properties"
* @required
*/
Expand Down
Expand Up @@ -39,85 +39,117 @@
* version and retrieves it from the remote repository. Once the archetype is retrieve it is process against
* a set of user parameters to create a working Maven project.
*
* @description Creates archetype containers.
* @requiresProject false
* @goal create
*/
public class MavenArchetypeMojo
extends AbstractMojo
{
/**
* Used to create the Archetype specified by the groupId, artifactId, and
* version from the remote repository.
*
* @component
*/
private Archetype archetype;

/**
* Used to create ArtifactRepository objects given the urls of the remote
* repositories.
*
* @component
*/
private ArtifactRepositoryFactory artifactRepositoryFactory;

/**
* Determines whether the layout is legacy or not.
*
* @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout" roleHint="default"
*/
private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;


/**
* Maven's local repository.
*
* @parameter expression="${localRepository}"
* @required
*/
private ArtifactRepository localRepository;

/**
* @parameter expression="${archetypeGroupId}" default-value="org.apache.maven.archetypes"
* The Archetype Group Id to be used.
*
* @parameter expression="${archetypeGroupId}" default-value="org.apache.maven.archetype"
* @required
*/
private String archetypeGroupId;

/**
* The Archetype Artifact Id to be used.
*
* @parameter expression="${archetypeArtifactId}" default-value="maven-archetype-quickstart"
* @required
*/
private String archetypeArtifactId;

/**
* The Archetype Version to be used.
*
* @parameter expression="${archetypeVersion}" default-value="RELEASE"
* @required
*/
private String archetypeVersion;

/**
* The Group Id of the project to be build.
*
* @parameter expression="${groupId}"
*/
private String groupId;

/**
* The Artifact Id of the project to be build.
*
* @parameter expression="${artifactId}"
*/
private String artifactId;

/**
* The Version of the project to be build.
*
* @parameter expression="${version}" default-value="1.0-SNAPSHOT"
* @required
*/
private String version;

/**
* The Package Name of the project to be build.
*
* @parameter expression="${packageName}" alias="package"
*/
private String packageName;

/**
* The remote repositories available for discovering dependencies and extensions as indicated
* by the POM.
*
* @parameter expression="${project.remoteArtifactRepositories}"
* @required
*/
private List pomRemoteRepositories;

/**
* Other remote repositories available for discovering dependencies and extensions.
*
* @parameter expression="${remoteRepositories}"
*/
private String remoteRepositories;

/**
* The project to be created an archetype of.
*
* @parameter expression="${project}"
*/
private MavenProject project;
Expand Down

0 comments on commit a69a339

Please sign in to comment.