/*** This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).
*
*@authorOlivier Lamy
*@since3.0*/@Documented
@Retention( RetentionPolicy.CLASS )
@Target( ElementType.TYPE )
@Inheritedpublic @interfaceMojo
{/*** goal name (required).唯一必须声明的标注,当用户命令行调用或在pom中配置插件是,需使用该目标名称
*@returnthe goal name*/String name();/**默认将该目标绑定至default声明周期的某个阶段,这样在配置使用插件目标时,就无需声明phase,如maven-surefire-plugin的test目标带有@phase tes标注* default phase to bind your mojo.
*@returnthe default phase*/LifecyclePhase defaultPhase()defaultLifecyclePhase.NONE;/**在运行mojo之前必须解析所有指定范围的依赖,如maven-surefire-plugin的test目标带有requiresDependencyResolution test标注,表示执行测试前,所有测试范围的依赖必须得到解析* the required dependency resolution scope.
*@returnthe required dependency resolution scope*/ResolutionScope requiresDependencyResolution()defaultResolutionScope.NONE;/*** the required dependency collection scope.
*@returnthe required dependency collection scope*/ResolutionScope requiresDependencyCollection()defaultResolutionScope.NONE;/*** your Mojo instantiation strategy. (Only per-lookup
and singleton
are supported)
*@returnthe instantiation strategy*/InstantiationStrategy instantiationStrategy()defaultInstantiationStrategy.PER_LOOKUP;/*** execution strategy: once-per-session
or always
.
*@returnonce-per-session
or always
*/String executionStrategy()default "once-per-session";/**该目标是否必须在一个maven项目中运行(如测试插件用于测试其他项目),默认为true。大部分插件目标需依赖一个项目才能运行,但是,maven-help-plugin的system目标例外,它用来显示系统属性和环境变量信息,无需实际项目。* does your mojo requires a project to be executed?
*@returnrequires a project*/
boolean requiresProject() default true;/**是否要求项目报告已经生成,默认为false* does your mojo requires a reporting context to be executed?
*@returnrequires a reporting context*/
boolean requiresReports() default false;/**当mojo在多模块项目上运行时,该标注表示目标只会在顶层模块运行。* if the Mojo uses the Maven project and its child modules.
*@returnuses the Maven project and its child modules*/
boolean aggregator() default false;/**为true时,该目标就只能通过命令行直接调用。默认为false* can this Mojo be invoked directly only?
*@returninvoked directly only*/
boolean requiresDirectInvocation() default false;/**是否要求maven必须是在线状态,默认值为false* does this Mojo need to be online to be executed?
*@returnneed to be online*/
boolean requiresOnline() default false;boolean inheritByDefault() default true;/*** own configurator class.
*@returnown configurator class*/String configurator()default "";/*** is your mojo thread safe (since Maven 3.x)?
*@returnis thread safe*/
boolean threadSafe() default false;
}