maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trent <>
Subject maven plugin configuration and binding execution to a phase/goal
Date Wed, 18 Jan 2012 03:24:16 GMT
I am stuck on two things while writing a plugin: (1) configuration,
and (2) binding to the right goal/phase automatically.  I am using
Maven 3.0.3, and trying to use the plugin for APK (android) packaged

(1) configuration.

 * @phase compile
 * @goal myGoal
 * @requiresDependencyResolution runtime
public class MyMojo extends AbstractMojo {

   * @parameter expression="${myGoal.aVal}" default-value="defaultVal"
  String aVal;


And in my pom using the plugin:



The problem is that I always get the default value instead of the
configured value.  What am I missing?

Am I required to provide the plugin.xml file, even for this simple case?

(2) Binding to the right goal/phase.

Ideally in the above example I don't want to specify <executions> for
my plugin.  But I can't figure out how to vary my annotations to get
it to work.

Can someone point out the problem, or a simple concrete example that
demonstrates this case please?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message