开发者

Developing Maven 3.0 Plugin

开发者 https://www.devze.com 2023-02-08 11:46 出处:网络
I have developed few Maven plugins for Maven 2, but I am wondering what are the main changes when I want to develop a plugin (or migrate the existing ones) for Maven 3.0.

I have developed few Maven plugins for Maven 2, but I am wondering what are the main changes when I want to develop a plugin (or migrate the existing ones) for Maven 3.0.

The documentation on the Maven site in not up-to-date (what a surprise!) and all related pages still deal with Maven 2.0, like this one:

This guide is intended to assist users in developing Java plugins for Maven 2.0.

As an example, in Maven 2 plugin, I defined a configuration parameter like this:

/**
 * Some parameter.
 * 
 * @parameter
 * @required
 */
private String foo;

So now, using the new Maven Plugin API, I expect real Java annotations...

Question: Where can I find documentation / information about the d开发者_Python百科evelopment of Maven 3 plugins?


There is now a work-in-progress implementation of annotations for Maven plugins developments! Read the following links:

  • https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
  • http://olamy.blogspot.fr/2012/05/java5-annotations-support-for-maven.html


for the record you can have a look http://maven.apache.org/plugin-tools/maven-plugin-plugin/examples/using-annotations.html


Just saw this... maybe it's helpful.

http://www.sonatype.com/people/2010/11/whats-in-maven-3-0-for-plugin-authors/


I think the best source is http://www.sonatype.com/books/mvnref-book/reference/index.html Maybe it is not up to date but it is the best choice in my oppinion.

For developing maven plugins see section 11.

I hope it was helpfull.


Don't know if this is still relevant but this plugin provides annotation support

Maven Anno Mojo


In meantime the official doc seems to be up to date: http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

(they use annotations everywhere)


This is the best I have been able to find regarding plugin development.

http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

Often the best way to work with maven is to use the archetype and play around with that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号