在参数项Maven插件API MOJO [英] Maven plugin MOJO API in term of parameters

查看:296
本文介绍了在参数项Maven插件API MOJO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的理解结果
该MOJO相对Maven的编译器插件结果的编译目标
定义了自己的参数,就像任何其他MOJO插件。

From my understanding
the MOJO relative to the compile goal of the maven-compiler-plugin
defines its own parameters,just like any other MOJO plugins.

例如它应该有一个参数定义有点像如下:

For example it should have a parameter defined somewhat like the following:

/** @parameter default-value="${project.build.sourceDirectory}" */
private String sDir; 

因此​​,这些参数的定义重新present一种API为MOJO,结果
我们可以通过各种方式设置,主要是从执行标记。

So these parameters definitions represent a kind of API for the MOJO,
that we can set in various way, mainly from the execution tag.

请,纠正我,如果我错了。

Please,correct me if I'm wrong.

我的问题是:
我在哪里可以申请标准Maven插件的API fefinition,
这些参数的任期?

My question is: Where can I filed the API fefinition of the standard maven plugin, in term of those parameters?

推荐答案

一个MOJO(或者更准确),因为它喜欢的(或者什么插件作者心中都有)一个插件的目标可以定义参数。是的,这意味着它是一种是通过通过插件的配置标签或有时通过命令行pom.xml中访问的API的(在特殊情况下的目标)

A MOJO (or be more accurate) a goal of a plugin can define the parameter as it likes (or what the plugin author has in mind). Yes this means it's is a kind of an API which is accessed via the pom.xml via the configuration tag of the plugin or sometimes via command line (in case of special goals).

对于每一个插件,您可以找到的文档在线例如像在Maven的编译器插件,你可以在这里找到合适的参数:

For every plugin you can find the documentation online like for example for the maven-compiler-plugin where you can find here the appropriate parameters:

https://maven.apache.org/plugins/ Maven的编译器插件/编译mojo.html

其中任何一个都位于的groupId的插件:org.apache.maven.plugins您可以通过此概述找到它:

Any of the plugins which are located in the groupId: org.apache.maven.plugins you can find it via this overview:

https://maven.apache.org/plugins/

,你可以在这里找到可用的目标列表中的插件已经,如果你去的链接,你会发现所有的参数页面上访问临客目标

and you can access the linke goals on the page where you find the list of available goals a plugin has and if you go to the link you will find all the parameters.

除此之外,你应该看看这里:

Apart from that you should take a look here:

  • https://maven.apache.org/developers/mojo-api-specification.html
  • https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html

有关的东西可以在将默认值被使用,您可以在这里看看:

For things which can be used in the defaultValue you can take a look here:

这篇关于在参数项Maven插件API MOJO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆