Re: maven plugin configuration and binding execution to a phase/goal

2012-01-18 Thread C Potter
Hi Manfred,

I've already posted my Android related questions on the Android Dev forum
yesterday that motivated the need for this.

These question here remain outstanding and all pertain solely to Maven...
 can someone please answer these...

(1) Configuration parameters - just using aVal did not work!  There is some
other problem below that I cannot spot.  Do I need a maven plugin xml to
make this happen?

(2) How do I bind to the right phase/goal without needing executions?

Thanks!

On Wed, Jan 18, 2012 at 12:03 AM, Manfred Moser manf...@mosabuam.comwrote:

 On 12-01-17 07:24 PM, Jeff Trent wrote:

 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
 modules.

 (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:

 build
plugins
plugin
groupIdmy.package/groupId
artifactIdmy-plugin-test/**artifactId
version1.0-SNAPSHOT/**version
configuration
aValmyConfiguredValue/aVal
/configuration
executions
execution
phasegenerate-resources/
 **phase
goals
goalmyGoal/goal
/goals
/execution
/executions
/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 specifyexecutions  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?

 Thanks,
 CP


 The expression should just be aVal... btw. what are you trying to do that
 the Android Maven Plugin does not do? You could implement the feature as a
 mojo there become part of that strong community..

 manfred

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@maven.**apache.orgusers-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: maven plugin configuration and binding execution to a phase/goal

2012-01-18 Thread Stephen Connolly
On 18 January 2012 13:32, C Potter cabin.pot...@gmail.com wrote:
 Hi Manfred,

 I've already posted my Android related questions on the Android Dev forum
 yesterday that motivated the need for this.

 These question here remain outstanding and all pertain solely to Maven...
  can someone please answer these...

 (1) Configuration parameters - just using aVal did not work!  There is some
 other problem below that I cannot spot.  Do I need a maven plugin xml to
 make this happen?

 (2) How do I bind to the right phase/goal without needing executions?

You don't... unless you implement a custom packaging type


 Thanks!

 On Wed, Jan 18, 2012 at 12:03 AM, Manfred Moser manf...@mosabuam.comwrote:

 On 12-01-17 07:24 PM, Jeff Trent wrote:

 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
 modules.

 (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:

 build
                plugins
                        plugin
                                groupIdmy.package/groupId
                                artifactIdmy-plugin-test/**artifactId
                                version1.0-SNAPSHOT/**version
                                configuration
                                        aValmyConfiguredValue/aVal
                                /configuration
                                executions
                                        execution
                                                phasegenerate-resources/
 **phase
                                                goals
                                                        goalmyGoal/goal
                                                /goals
                                        /execution
                                /executions
                        /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 specifyexecutions  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?

 Thanks,
 CP


 The expression should just be aVal... btw. what are you trying to do that
 the Android Maven Plugin does not do? You could implement the feature as a
 mojo there become part of that strong community..

 manfred

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@maven.**apache.orgusers-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: maven plugin configuration and binding execution to a phase/goal

2012-01-17 Thread Manfred Moser

On 12-01-17 07:24 PM, Jeff Trent wrote:

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
modules.

(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:

build
plugins
plugin
groupIdmy.package/groupId
artifactIdmy-plugin-test/artifactId
version1.0-SNAPSHOT/version
configuration
aValmyConfiguredValue/aVal
/configuration
executions
execution

phasegenerate-resources/phase
goals
goalmyGoal/goal
/goals
/execution
/executions
/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 specifyexecutions  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?

Thanks,
CP


The expression should just be aVal... btw. what are you trying to do 
that the Android Maven Plugin does not do? You could implement the 
feature as a mojo there become part of that strong community..


manfred

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org