Annotation Interface MojoParameters


@Target({METHOD,PARAMETER}) @Retention(RUNTIME) @Inherited public @interface MojoParameters
Container annotation for multiple MojoParameter annotations. This annotation is automatically used by Java when multiple @MojoParameter annotations are applied to the same element.

While this annotation can be used directly, it's generally more convenient to use multiple @MojoParameter annotations, which Java will automatically wrap in this container annotation.

Example of direct usage:

 
 @Test
 @InjectMojo(goal = "compile")
 @MojoParameters({
     @MojoParameter(name = "source", value = "1.8"),
     @MojoParameter(name = "target", value = "1.8"),
     @MojoParameter(name = "debug", value = "true")
 })
 void testCompilation(CompileMojo mojo) {
     mojo.execute();
 }
 
 

Equivalent usage with repeatable annotation:

 
 @Test
 @InjectMojo(goal = "compile")
 @MojoParameter(name = "source", value = "1.8")
 @MojoParameter(name = "target", value = "1.8")
 @MojoParameter(name = "debug", value = "true")
 void testCompilation(CompileMojo mojo) {
     mojo.execute();
 }
 
 
Since:
4.0.0
See Also:
  • Element Details