lsvidal / lab-mvn-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A start this lab to study the creation of maven plugins for a mantenance job of a old aplication generator. It uses Javadoc tags style rather than the Java 1.5 annotations style (ref). I'm following Sonatype's tutorial

Running

For lazyness sake I didn't create a whole project to test it. I just made an alternate pom.xml named pom-test.xml that can be run as mvn -f pom-test.xml greeter:greet. Note that I by naming the plugin greeter-maven-pluging according to Maven pluging naming Convention, I'm able to use short syntax greeter:greet rather than using groupId:archetypeId syntax. By using the tag @requiresproject set to false, this plugin can be run without a project. In this case, maven won't be able to use plugin prefix shorthand used previously, so it is necessary to use full groupId:archetypeId syntax or to use maven-plugin-plugin and pluginGroups as explained in Sonatype's tutorial.

The plugin accepts a parameter (ref) named greeter.message that can be passed in command line, i.e., -Dgreeter.message='Hello World again!'. The parameter also has a default value defined.

About


Languages

Language:Java 100.0%