Is it possible to define a mojo that takes a list of objects as a parameter?

Reading in the maven plugin development guide. I see that you can define list parameters and arbitrary object parameters, but is it possible to define a parameter that identifies a list of objects defined as:

/**
 * @parameter
 */
private List<MyObject> objects;

      

+3


source to share


2 answers


Of course, I do this all the time. Make sure MyObject is a Java bean with every attribute annotated with @parameter and so on, as if every parameter were in the Mojo itself.



+4


source


I haven't even commented on anything in MyObject, just specify the parameter.

@Parameter(property = "versioning.scripts")
private List<MyObject> scripts;

      



and everything works fine.

+1


source







All Articles