That is really a default value not an expression
On 17 January 2013 17:01, Huang, Roger <[email protected]> wrote: > > Is there a way to specify an expression for the Mojo annotation @parameter > in Maven 3? > > I have a Mojo, GenerateConfigMojo.java, with property > "deliverableSettings" of type java.io.File. > Here is the original GenerateConfigMojo.java, built w/ Maven 2.2.1: > > /** > * Goal which touches a timestamp file. > * > * @goal generate-config > * @phase generate-resources > */ > public class GenerateConfigMojo extends AbstractMojo { > > <snip> > /** > * @parameter expression="${basedir}/settings.xconfig" > * @required > */ > private File deliverableSettings; > > When I build this with Maven 3.0.4, I get this WARNING: > > [WARNING] > com.paypal.maven.plugins.deliverable.GenerateConfigMojo#deliverableSettings:^M > [WARNING] The syntax^M > [WARNING] @parameter expression="${property}"^M > [WARNING] is deprecated, please use^M > [WARNING] @parameter property="property"^M > [WARNING] instead.^M > > My current solution is to set the expression value in the Java code. > I changed the Java 5 annotation to > > /** > * Goal which touches a timestamp file. > * > * @goal generate-config > * @phase generate-resources > */ > public class GenerateConfigMojo extends AbstractMojo { > > <snip> > /** > * @parameter property="basedir" > * @required > */ > private File deliverableSettingsBaseDir; > > <snip> > > this.deliverableSettings = new File( > this.deliverableSettingsBaseDir.getPath() + "/settings.xconfig"); > > Is there a way to still specify the expression via annotations? > > Thanks, > Roger > >
