org.apache.maven.plugins.annotations
Annotation Type Mojo


@Documented
@Retention(value=CLASS)
@Target(value=TYPE)
@Inherited
public @interface Mojo

This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).

Since:
3.0
Author:
Olivier Lamy

Required Element Summary
 String name
          goal name (required).
 
Optional Element Summary
 boolean aggregator
          if the Mojo uses the Maven project and its child modules.
 String configurator
          own configurator class.
 LifecyclePhase defaultPhase
          default phase to bind your mojo.
 String executionStrategy
          execution strategy: once-per-session or always.
 boolean inheritByDefault
           
 InstanciationStrategy instantiationStrategy
          your Mojo instantiation strategy.
 ResolutionScope requiresDependencyCollection
          the required dependency collection scope.
 ResolutionScope requiresDependencyResolution
          the required dependency resolution scope.
 boolean requiresDirectInvocation
          can this Mojo be invoked directly only?
 boolean requiresOnline
          does this Mojo need to be online to be executed?
 boolean requiresProject
          does your mojo requires a project to be executed?
 boolean requiresReports
          does your mojo requires a reporting context to be executed?
 boolean threadSafe
          is your mojo thread safe (since Maven 3.x)?
 

Element Detail

name

public abstract String name
goal name (required).

Returns:
the goal name

defaultPhase

public abstract LifecyclePhase defaultPhase
default phase to bind your mojo.

Returns:
the default phase
Default:
org.apache.maven.plugins.annotations.LifecyclePhase.NONE

requiresDependencyResolution

public abstract ResolutionScope requiresDependencyResolution
the required dependency resolution scope.

Returns:
Default:
org.apache.maven.plugins.annotations.ResolutionScope.RUNTIME

requiresDependencyCollection

public abstract ResolutionScope requiresDependencyCollection
the required dependency collection scope.

Returns:
Default:
org.apache.maven.plugins.annotations.ResolutionScope.RUNTIME

instantiationStrategy

public abstract InstanciationStrategy instantiationStrategy
your Mojo instantiation strategy. (Only per-lookup and singleton are supported)

Returns:
the instantiation strategy
Default:
org.apache.maven.plugins.annotations.InstanciationStrategy.PER_LOOKUP

executionStrategy

public abstract String executionStrategy
execution strategy: once-per-session or always.

Returns:
once-per-session or always
Default:
"once-per-session"

requiresProject

public abstract boolean requiresProject
does your mojo requires a project to be executed?

Returns:
Default:
true

requiresReports

public abstract boolean requiresReports
does your mojo requires a reporting context to be executed?

Returns:
Default:
false

aggregator

public abstract boolean aggregator
if the Mojo uses the Maven project and its child modules.

Returns:
Default:
false

requiresDirectInvocation

public abstract boolean requiresDirectInvocation
can this Mojo be invoked directly only?

Returns:
Default:
false

requiresOnline

public abstract boolean requiresOnline
does this Mojo need to be online to be executed?

Returns:
Default:
false

inheritByDefault

public abstract boolean inheritByDefault
Default:
true

configurator

public abstract String configurator
own configurator class.

Returns:
Default:
""

threadSafe

public abstract boolean threadSafe
is your mojo thread safe (since Maven 3.x)?

Returns:
Default:
false


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.