I have a parameter in my custom plugin that is an array. If the parameter isn't given anything, I want to set the default-value to be a blank array. Of course, here is the normal syntax for a regular variable:
/**
* @parameter default-value="Hello Maven World"
*/
private String message;
But my array is set like this:
/**
* @parameter
*/
private String[] message;
How would I set the default-value of an array variable as a parameter in a custom maven plugin?
It should be possible to set the default values directly in the code instead of using a tag. This value can still be overridden in the pom file.
/**
* @parameter
*/
private String[] message = new String[0];
That will give you an empty array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With