Annotation Type MojoParameters


@Retention(RUNTIME) @Inherited @Target({TYPE,METHOD,PARAMETER}) 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:
3.4.0
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description