I am writing a maven plugin with several custom options. The Mojo class has a number of parameters. One of these parameters is required and must contain certain values (say, either Atwood or Spolsky). At the moment, it is annotated using. @required field as shown here:
public class GenerateMojo extends AbstractMojo{
...
...
private String someParameter;
...
...
}
That all is well and good, but if someone forgets to enable the parameter, he receives a general error message:
Inside the definition for plugin 'xyz' specify the following:
<configuration>
...
<someParameter>VALUE</someParameter>
</configuration>
If it is possible (1) to limit the values that can be entered in the someParmeter field to give a better error message, or (2) specify the error message myself, so that I can write something like "Value for", someParameter should be either "Atwood" or "Spolsky"
thanks