Java Maven Mojo : Object Class Default Value -


i trying write maven plugin in java. want in following manner:

<pluginaction>tokenreplace</pluginaction>    <tokenreplacerconfig>            <prop1>a</prop1>            <prop2>b</prop2>     </tokenreplacerconfig> 

for have following main mojo java class:

public class token extends abstractmojo{    @parameter(defaultvalue="tokenreplace")     private string pluginaction;      @parameter      private tokenreplacerconfig tokenreplacerconfig;       .....     } 

my tokenreplacerconfig class follows:

public class tokenreplacerconfig{    private string prop1;    private string prop2;     ...  } 

my question that, want have default values set prop1 , prop2 in case user using plugin doesn't provide tag. want know how can achieve this.

i tried:

  public class tokenreplacerconfig{    @parameter(defaultvalue="a")    private string prop1;    @parameter(defaultvalue="b")    private string prop2;     ...  } 

this doesn't seem work me.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -