...
This project has also been converted into an archetype to make it even easier to use. (NOTE:
Warning | ||
---|---|---|
| ||
The plugin is currently not deployed. Use the Sample IT project for now and skip this section -Brianf 8/21/07 |
...
Wiki Markup It would be helpful to review the archetypeNG plugin tutorial here: \[insert url of site when it lands at apache\]
The maven-archetypeng-plugin is currently a snapshot. You will need to add the snapshot repository to your settings to be able to retreive the plugin and the archetype (when it gets deployed).
No Format <settings> ... <profiles> <profile> <id>maven-snapshots</id> <repositories> <repository> <id>Maven Snapshots</id> <url>http://people.apache.org/repo/m2-snapshot-repository</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </repository> <repositories> <profile> <profiles> <!--need to activate my profile unless I want to type 'mvn -Pmaven-snapshots' all the time--> <activeProfiles> <activeProfile>maven-snapshots</activeProfile> </activeProfiles> </settings>
The archetypeNG plugin maintains a list of known archetype groups for interactive prompting. The next step is to add the IT group:
No Format mvn archetypeng:add-groups -Dgroups=org.apache.maven.its
Successful output:
No Format E:\svn\Maven\atest>mvn archetypeng:add-groups -Dgroups=org.apache.maven.its [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetypeng'. [INFO] ---------------------------------------------------------------------------- [INFO] Building Maven Default Project [INFO] task-segment: [archetypeng:add-groups] (aggregator-style) [INFO] ---------------------------------------------------------------------------- [INFO] [archetypeng:add-groups] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 seconds [INFO] Finished at: Wed Aug 08 21:58:57 EDT 2007 [INFO] Final Memory: 5M/10M [INFO] ------------------------------------------------------------------------
Now you can create the archetype project:
No Format mvn archetype:create
No Format $ mvn archetypeng:create Using maven.home=c:\Program Files\maven2\bin\\.. [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetypeng'. [INFO] ---------------------------------------------------------------------------- [INFO] Building Maven Default Project [INFO] task-segment: [archetypeng:create] (aggregator-style) [INFO] ---------------------------------------------------------------------------- [INFO] Preparing archetypeng:create [INFO] [archetypeng:select-archetype] Choose group: 1: org.apache.maven.archetypes 2: org.codehaus.mojo.archetypes 3: org.apache.maven.its Choose a number: (1/2/3): 3 [INFO] org.apache.maven.its: checking for updates from central Choose archetype: 1: Unnamed - org.apache.maven.its:maven-integration-test-sample-archetype:maven-archetype:1.0-SNAPSHOT (org.apache.maven.its:maven-integration-test-sample-arche type) Choose a number: (1): 1 [INFO] org.apache.maven.its.maven-integration-test-sample-archetype: checking for updates from central Choose version: 1: 1.0-SNAPSHOT Choose a number: (1): 1 Confirm archetype selection: org.apache.maven.its/Unnamed - org.apache.maven.its:maven-integration-test-sample-archetype:maven-archetype:1.0-SNAPSHOT (Y/N) Y: : Y [INFO] snapshot org.apache.maven.its:maven-integration-test-sample-archetype:1.0-SNAPSHOT: checking for updates from central [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetypeng:configure-generation] Define value for groupId: : org.apache.maven.its Define value for artifactId: : my-it Define value for version: : 1 Define value for package: : pom Confirm properties configuration: groupId: org.apache.maven.its artifactId: my-it version: 1 package: pom Y: : Y [INFO] [archetypeng:generate-project] [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/test/resources/mng-xxxx-descriptionOfProblem/ checkstyle-test/pom.xml [line 42,column 26] : ${project.build.directory} is not a valid reference. [INFO] [archetypeng:create] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 29 seconds [INFO] Finished at: Tue Aug 21 21:27:41 EDT 2007 [INFO] Final Memory: 7M/14M [INFO] ------------------------------------------------------------------------
The project will be created in a subfolder of your current directory with the name you chose for the artifact. (my-it in the above example).
Tour of the Sample Project
...