Annotation Type InjectMojo
-
@Retention(RUNTIME) @Inherited @Target({METHOD,PARAMETER}) public @interface InjectMojoAnnotation used in Maven plugin tests to inject and configure a Mojo instance. This annotation can be applied to either test methods or parameters to specify which Mojo should be instantiated and how it should be configured.The annotation requires a
goalattribute to specify which Mojo goal should be instantiated. Optionally, a customPOMfile can be specified to provide specific configuration for the test.Example usage on a test method:
{@code- Since:
- 3.4.0
- See Also:
MojoTest,MojoParameter,MojoExtension
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringgoalSpecifies the goal of the Mojo to instantiate.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringpomSpecifies an optional POM file to use for Mojo configuration.
-
-
-
-
pom
java.lang.String pom
Specifies an optional POM file to use for Mojo configuration. The path is relative to the test class location.NOTE: only plugin configuration is taken from provided POM, all other tags are ignored.
If not specified, the default project configuration will be used.
- Returns:
- the path to a custom POM file, or an empty string to use defaults
- Default:
- ""
-
-