How do I add a site to a project using the archetype plugin?
Author: Deron Eriksson
Description: This maven tutorial describes how to add site files to a project using the archetype plugin.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)

Page:    1 2 >

In another tutorial, we created an EclipseSW external tool configuration to add simple site files to an existing project. This involved calling the archetype:create goal with an archetypeArtifactId parameter. We can use a similar technique to add more involved site documentation to an existing project via -DarchetypeArtifactId=maven-archetype-site. An external tool configuration to do this is shown here:

Name:mvn archetype~create site
Working Directory:${workspace_loc}
Arguments:archetype:create -DgroupId=${string_prompt:groupId} -DartifactId=${string_prompt:artifactId} -DarchetypeArtifactId=maven-archetype-site

The ${maven_exec} string substitution variable points to my mavenSW mvn.bat file (C:\dev\apache-maven-2.0.8\bin\mvn.bat). Notice that the working directory is my Eclipse workspace directory. Also notice that the groupId and the artifactId of the project in question need to be entered via prompts.

External Tool Configuration

I'd like to add site documentation files to my "aproject" project.


I'll execute the "mvn archetype~create site" configuration.

Executing 'mvn archetype~create site'

I enter the groupId of my "aproject" project, which is "com.maventest".

Entering groupId

Next, I enter its artifactId, "aproject".

Entering artifactId

(Continued on page 2)

Page:    1 2 >

Related Tutorials: