Re: How to Invoke different goals of 1 plugin

2010-03-18 Thread izak.wessels

We still want the plugin to be inherited by the child projects. 

But thanks for the clarification on the syntax. 
-Original Message-
From: "stephenconnolly [via maven users]" 

Date: Thu, 18 Mar 2010 04:16:17 
To: izak.wessels
Subject: Re: How to Invoke different goals of 1 plugin




  

  
maven-antrun-plugin
1.1

  
echodir

  run

verify
*false*   

  
Build Dir: ${project.build.directory}
  

  


  

  



On 18 March 2010 11:59, izak.wessels  wrote:

>
>
> stephenconnolly wrote:
> >
> > give each execution a different 
> >
> > and if you don;t want something inherited by child projects, set
> > false
> >
>
> Yup, we tried that.
>
> Example :
>
> 
> 
>  
>org.apache.maven.plugins
>maven-pmd-plugin
>2.4
>
>  
> pmd-default
> generate-sources
>
>  check
>
>  
>   
>pmd-sonar
> generate-sources
>
>  pmd
>
>  
>
>  
> 
> 
>
> 2 issues with that approach:
>
>
> 1. How do we tell maven which execution we want to run?
>

You don't

It will run all the executions that are bound to the lifecycle automatically

If you want something different, use ANT, or hack away using profiles and
activation rules and then spend ages explainging to people why even though
you have used a build tool which has a standard lifecycle, you are ignoring
that and ending up back in the "what ant task do I run to do ___" mire


>
> 2. From what we understand you cannot just say false
> in the child pom.xml, you would have to do something like,
>
> 
>  org.apache.maven.plugins
>  maven-pmd-plugin
>  false
> 
>
> However, we still want our plugin to run in our child projects, just run
> against a different goal based on question 1
>
> --
> View this message in context:
> http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4755993.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


__
View message @ 
http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4756077.html

To unsubscribe from Re: How to Invoke different goals of 1 plugin, click  (link 
removed) =


-- 
View this message in context: 
http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4756104.html
Sent from the maven users mailing list archive at Nabble.com.

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



Re: How to Invoke different goals of 1 plugin

2010-03-18 Thread izak.wessels


stephenconnolly wrote:
> 
> give each execution a different 
> 
> and if you don;t want something inherited by child projects, set
> false
> 

Yup, we tried that. 

Example : 



  
org.apache.maven.plugins
maven-pmd-plugin
2.4

  
pmd-default
generate-sources

  check

  
  
pmd-sonar
generate-sources

  pmd

  

  



2 issues with that approach: 


1. How do we tell maven which execution we want to run?

2. From what we understand you cannot just say false
in the child pom.xml, you would have to do something like, 


 org.apache.maven.plugins
 maven-pmd-plugin
 false


However, we still want our plugin to run in our child projects, just run
against a different goal based on question 1

-- 
View this message in context: 
http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4755993.html
Sent from the maven users mailing list archive at Nabble.com.

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



How to Invoke different goals of 1 plugin

2010-03-18 Thread izak.wessels

Hi, 

We would like to invoke different goals on 1 plugin. 

>From reading the documentation, it seems that the best way to achieve this
is to setup a profile and specify the same plugin but with a different goal. 

Here is the 1st time that the plugin is defined in the pom.xml. Take note of
the goal in this scenario 'check' (This should execute by default) 



  
org.apache.maven.plugins
maven-pmd-plugin
2.4

  
generate-sources

  check

  

  



And now for the profile, the goal in this case is 'pmd' : 



  sonar
  

  
org.apache.maven.plugins
maven-pmd-plugin
2.4

  
generate-sources

  pmd

  

  

  



(Side note : We have to execute it during the generate-sources phase as we
have other plugins that alters the source and any other phase is too late
for this plugin in our environment)

However, this approach seems to ONLY be valid for the top level. Once it
decends into the child projects, then it seems to merge the goals, 'check'
first & 'pmd' thereafter (which doesn't seem to work correctly - see
http://jira.codehaus.org/browse/MNG-4022). The documentation does mention
that stuff will be merged but it fails to mention a.) is it possible to get
around it? and b.) if it is possible, how would one go about it.

We had a look into execution id's as well, but it seems that they are only
bound to a lifecycle and cannot be used in our scenario. 

Any help would be much appreciated, 

-- izak









-- 
View this message in context: 
http://n2.nabble.com/How-to-Invoke-different-goals-of-1-plugin-tp4755892p4755892.html
Sent from the maven users mailing list archive at Nabble.com.

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