Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Blah, blah, blah

gmaven-archetype-mojo Archetype

To help get Groovy plugins started faster, you can use the gmaven-archetype-mojo. This will create a new project with the basic POM configuration and an example Groovy-based Mojo class to get you started quickly:

mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -DarchetypeArtifactId=gmaven-archetype-mojo
Icon

To use a specific version of an archetype specify -DarchetypeVersion=<VERSION>.

The Maven Archetype Plugin will ask a few questions about your new project:

[INFO] [archetype:generate]
...
Define value for groupId: : org.mycompany.myproject
Define value for artifactId: : example-maven-plugin
Define value for version: : 1.0-SNAPSHOT
Define value for package: : org.mycompany.myproject.example
Confirm properties configuration:
name: Example Maven Plugin
groupId: org.mycompany.myproject
artifactId: example-maven-plugin
version: 1.0-SNAPSHOT
package: org.mycompany.myproject.example
 Y: : y
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
...
Icon

Please ignore any ReferenceException warnings about ${...}, they are harmless.

The above example would have created the following project structure:

example-maven-plugin
example-maven-plugin/pom.xml
example-maven-plugin/src
example-maven-plugin/src/main
example-maven-plugin/src/main/groovy
example-maven-plugin/src/main/groovy/org
example-maven-plugin/src/main/groovy/org/mycompany
example-maven-plugin/src/main/groovy/org/mycompany/myproject
example-maven-plugin/src/main/groovy/org/mycompany/myproject/example
example-maven-plugin/src/main/groovy/org/mycompany/myproject/example/HelloMojo.groovy

gmaven-plugin Packaging

Icon

TODO

  • No labels