...
This project has also been converted into an archetype to make it even easier to use.
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 archetypeNGarchetype plugin tutorial here: \[insert url of site when it lands at apache\]
The
...
Archetype Plugin doesn't currently now by default this archetype, so we created a catalog file to be used.
No Format |
---|
mvn archetype:generate -DarchetypeCatalog=http://docs.codehaus.org/download/attachments/1835439/archetype-catalog.xml
|
No Format |
---|
$ mvn archetype:generate -DarchetypeCatalog=http://docs.codehaus.org/download/attachments/1835439/archetype-catalog.xml
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ---------------- |
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
|
...
------------------------------------------------------- |
...
- [INFO] Building Maven Default Project [INFO] |
...
|
...
|
...
task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [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] [archetype:generate] Choose archetype: 1: remote -> maven-integration-test-sample-archetype |
...
(Archetype for |
...
creating |
...
a Maven 2 Integration Test) Choose a number: (1): 1 [INFO] |
...
snapshot org.apache.maven.its:maven-integration-test-sample-archetype:1.0-SNAPSHOT: checking for updates from maven-integration-test-sample-archetype-repo Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/its/maven-integration-test-sample-archetype/1.0-SNAPSHOT/maven-integration-test-sample-archetype-1.0-20080303.190914-2.jar 9K downloaded Define value for groupId: : org.apache.maven.its Define value for artifactId: : my-it Define value for version: : 1 Define value for package: : |
...
org.apache.maven.integrationTests Confirm properties configuration: groupId: org.apache.maven.its artifactId: my-it version: 1 package: |
...
org.apache.maven.integrationTests Y: : Y [ |
...
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] |
...
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: |
...
44 seconds [INFO] Finished at: |
...
Mon |
...
Mar |
...
03 |
...
19: |
...
13:41 |
...
GMT |
...
2008 [INFO] Final Memory: |
...
10M/ |
...
28M [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
...