You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by tc...@apache.org on 2013/10/30 22:01:01 UTC

svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Author: tchemit
Date: Wed Oct 30 21:01:01 2013
New Revision: 1537302

URL: http://svn.apache.org/r1537302
Log:
MRAR-34 - provide skip parameter for the plugin

Modified:
    maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Modified: maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java?rev=1537302&r1=1537301&r2=1537302&view=diff
==============================================================================
--- maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java (original)
+++ maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java Wed Oct 30 21:01:01 2013
@@ -265,12 +265,26 @@ public class RarMojo
     @Parameter( property = "warnOnMissingRaXml", defaultValue = "true" )
     protected boolean warnOnMissingRaXml = true;
 
+    /**
+     * To skip execution of the rar mojo.
+     *
+     * @since 2.4
+     */
+    @Parameter( property = "maven.rar.skip" )
+    private boolean skip;
+
     private File buildDir;
 
 
     public void execute()
         throws MojoExecutionException
     {
+
+        if ( skip )
+        {
+            getLog().info( "Skipping rar generation." );
+        }
+
         getLog().debug( " ======= RarMojo settings =======" );
         getLog().debug( "rarSourceDirectory[" + rarSourceDirectory + "]" );
         getLog().debug( "manifestFile[" + manifestFile + "]" );



Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Hervé BOUTEMY <he...@free.fr>.
I updated http://maven.apache.org/developers/mojo-api-specification.html#The_Descriptor_and_Annotations

any other good idea welcome

Regards,

Hervé

Le jeudi 31 octobre 2013 17:12:38 vous avez écrit :
> Hello,
> 
> Am 31.10.2013, 10:36 Uhr, schrieb Hervé BOUTEMY <he...@free.fr>:
> > but for the way to configure the parameter (ie parameter vs expression),
> > it's
> > more than a convention, it's a change in plugin-tools in version 3.0,
> > done
> > when adding Java 5 annotations support: expression was the parameter name
> > provided as javadoc annotations, but it was changed in Java 5
> > annotations:
> > 1. expanded to not need ${} in
> > http://jira.codehaus.org/browse/MPLUGIN-194
> > 2. renamed to property in http://jira.codehaus.org/browse/MPLUGIN-196
> 
> I see, I was checking a random documentation page on the Web first because
> I remebered having seen expressions as default values to be usefull in the
> Mojos (and some did not had some).
> 
> I was first visiting this page:
> 
> http://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.ht
> ml
> 
> But as it did not describe the defaultValue/property so I was following
> the link at the end to
> 
> http://maven.apache.org/developers/mojo-api-specification.html#The_Descripto
> r_and_Annotations
> 
> And I missed the fact that this is not describing the Java annotations but
> the JavaDoc ones. So sorry for the confusion. (But maybe it would be
> helpful to change the table header from "Annotations" to "JavaDoc Tag"?
> 
> And the new annotations page really need a detailed description (javadoc?)
> of the annotation attributes or link to the apidoc, like:
> http://maven.apache.org/plugin-tools/maven-plugin-annotations/apidocs/index.
> html
> > And this means that @Parameter( property = "maven.rar.skip" ) makes the
> > property available from the command line, no problem
> 
> Agreed, you diagnosted the right reason for my wrong comment :)
> 
> Bernd


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

Am 31.10.2013, 10:36 Uhr, schrieb Hervé BOUTEMY <he...@free.fr>:
> but for the way to configure the parameter (ie parameter vs expression),  
> it's
> more than a convention, it's a change in plugin-tools in version 3.0,  
> done
> when adding Java 5 annotations support: expression was the parameter name
> provided as javadoc annotations, but it was changed in Java 5  
> annotations:
> 1. expanded to not need ${} in  
> http://jira.codehaus.org/browse/MPLUGIN-194
> 2. renamed to property in http://jira.codehaus.org/browse/MPLUGIN-196

I see, I was checking a random documentation page on the Web first because  
I remebered having seen expressions as default values to be usefull in the  
Mojos (and some did not had some).

I was first visiting this page:

http://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html

But as it did not describe the defaultValue/property so I was following  
the link at the end to

http://maven.apache.org/developers/mojo-api-specification.html#The_Descriptor_and_Annotations

And I missed the fact that this is not describing the Java annotations but  
the JavaDoc ones. So sorry for the confusion. (But maybe it would be  
helpful to change the table header from "Annotations" to "JavaDoc Tag"?

And the new annotations page really need a detailed description (javadoc?)  
of the annotation attributes or link to the apidoc, like:  
http://maven.apache.org/plugin-tools/maven-plugin-annotations/apidocs/index.html

> And this means that @Parameter( property = "maven.rar.skip" ) makes the
> property available from the command line, no problem

Agreed, you diagnosted the right reason for my wrong comment :)

Bernd
-- 
http://www.zusammenkunft.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Hervé BOUTEMY <he...@free.fr>.
Le jeudi 31 octobre 2013 07:54:25 Tony Chemit a écrit :
> On Thu, 31 Oct 2013 00:20:27 +0100
> 
> "Bernd Eckenfels" <ec...@zusammenkunft.net> wrote:
> > Am 31.10.2013, 00:06 Uhr, schrieb Olivier Lamy <ol...@apache.org>:
> > > On 31 October 2013 08:01,  <tc...@apache.org> wrote:
> > >> +    @Parameter( property = "maven.rar.skip" )
> > >> +    private boolean skip;
> > 
> > Does it make sense to add a expression="${maven.rar.skip}" (or maybe
> > ${skipMavenRar}?). Especially the skip function is usefull from the
> > command line.
> 
> Hum I follow the *convention* used by other plugins :
> 
> maven.test.skip
> maven.javadoc.skip
> maven.install.skip
> ...
in fact, the convention is about the parameter name
but for the way to configure the parameter (ie parameter vs expression), it's 
more than a convention, it's a change in plugin-tools in version 3.0, done 
when adding Java 5 annotations support: expression was the parameter name 
provided as javadoc annotations, but it was changed in Java 5 annotations:
1. expanded to not need ${} in http://jira.codehaus.org/browse/MPLUGIN-194
2. renamed to property in http://jira.codehaus.org/browse/MPLUGIN-196

And this means that @Parameter( property = "maven.rar.skip" ) makes the 
property available from the command line, no problem

Regards,

Hervé


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Tony Chemit <ch...@codelutin.com>.
On Thu, 31 Oct 2013 00:20:27 +0100
"Bernd Eckenfels" <ec...@zusammenkunft.net> wrote:

> Am 31.10.2013, 00:06 Uhr, schrieb Olivier Lamy <ol...@apache.org>:
> > On 31 October 2013 08:01,  <tc...@apache.org> wrote:
> >> +    @Parameter( property = "maven.rar.skip" )
> >> +    private boolean skip;
> 
> Does it make sense to add a expression="${maven.rar.skip}" (or maybe  
> ${skipMavenRar}?). Especially the skip function is usefull from the  
> command line.

Hum I follow the *convention* used by other plugins : 

maven.test.skip
maven.javadoc.skip
maven.install.skip
...

> 
> Bernd
> 
> >> +        if ( skip )
> >> +        {
> >> +            getLog().info( "Skipping rar generation." );
> >> +        }
> >> +
> >
> > really skipping? :-)
> >
> >>          getLog().debug( " ======= RarMojo settings =======" );
> >>          getLog().debug( "rarSourceDirectory[" + rarSourceDirectory +  
> >> "]" );
> >>          getLog().debug( "manifestFile[" + manifestFile + "]" );
> 
> Is there a best practise for printing parameters before or after early  
> return?

I don't know

tony.


-- 
Tony Chemit
--------------------
tél: +33 (0) 2 40 50 29 28
http://www.codelutin.com
email: chemit@codelutin.com
twitter: https://twitter.com/tchemit

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Am 31.10.2013, 00:06 Uhr, schrieb Olivier Lamy <ol...@apache.org>:
> On 31 October 2013 08:01,  <tc...@apache.org> wrote:
>> +    @Parameter( property = "maven.rar.skip" )
>> +    private boolean skip;

Does it make sense to add a expression="${maven.rar.skip}" (or maybe  
${skipMavenRar}?). Especially the skip function is usefull from the  
command line.

Bernd

>> +        if ( skip )
>> +        {
>> +            getLog().info( "Skipping rar generation." );
>> +        }
>> +
>
> really skipping? :-)
>
>>          getLog().debug( " ======= RarMojo settings =======" );
>>          getLog().debug( "rarSourceDirectory[" + rarSourceDirectory +  
>> "]" );
>>          getLog().debug( "manifestFile[" + manifestFile + "]" );

Is there a best practise for printing parameters before or after early  
return?

Gruss
Bernd
-- 
http://www.zusammenkunft.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Tony Chemit <ch...@codelutin.com>.
On Thu, 31 Oct 2013 10:06:07 +1100
Olivier Lamy <ol...@apache.org> wrote:

> On 31 October 2013 08:01,  <tc...@apache.org> wrote:
> > Author: tchemit
> > Date: Wed Oct 30 21:01:01 2013
> > New Revision: 1537302
> >
> > URL: http://svn.apache.org/r1537302
> > Log:
> > MRAR-34 - provide skip parameter for the plugin
> >
> > Modified:
> >     maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java
> >
> > Modified: maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java
> > URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java?rev=1537302&r1=1537301&r2=1537302&view=diff
> > ==============================================================================
> > --- maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java (original)
> > +++ maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java Wed Oct 30 21:01:01 2013
> > @@ -265,12 +265,26 @@ public class RarMojo
> >      @Parameter( property = "warnOnMissingRaXml", defaultValue = "true" )
> >      protected boolean warnOnMissingRaXml = true;
> >
> > +    /**
> > +     * To skip execution of the rar mojo.
> > +     *
> > +     * @since 2.4
> > +     */
> > +    @Parameter( property = "maven.rar.skip" )
> > +    private boolean skip;
> > +
> >      private File buildDir;
> >
> >
> >      public void execute()
> >          throws MojoExecutionException
> >      {
> > +
> > +        if ( skip )
> > +        {
> > +            getLog().info( "Skipping rar generation." );
> > +        }
> > +
> 
> really skipping? :-)

my bad :( ...

> 
> >          getLog().debug( " ======= RarMojo settings =======" );
> >          getLog().debug( "rarSourceDirectory[" + rarSourceDirectory + "]" );
> >          getLog().debug( "manifestFile[" + manifestFile + "]" );
> >
> >
> 
> 
> 



-- 
Tony Chemit
--------------------
tél: +33 (0) 2 40 50 29 28
http://www.codelutin.com
email: chemit@codelutin.com
twitter: https://twitter.com/tchemit

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1537302 - /maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java

Posted by Olivier Lamy <ol...@apache.org>.
On 31 October 2013 08:01,  <tc...@apache.org> wrote:
> Author: tchemit
> Date: Wed Oct 30 21:01:01 2013
> New Revision: 1537302
>
> URL: http://svn.apache.org/r1537302
> Log:
> MRAR-34 - provide skip parameter for the plugin
>
> Modified:
>     maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java
>
> Modified: maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java
> URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java?rev=1537302&r1=1537301&r2=1537302&view=diff
> ==============================================================================
> --- maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java (original)
> +++ maven/plugins/trunk/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java Wed Oct 30 21:01:01 2013
> @@ -265,12 +265,26 @@ public class RarMojo
>      @Parameter( property = "warnOnMissingRaXml", defaultValue = "true" )
>      protected boolean warnOnMissingRaXml = true;
>
> +    /**
> +     * To skip execution of the rar mojo.
> +     *
> +     * @since 2.4
> +     */
> +    @Parameter( property = "maven.rar.skip" )
> +    private boolean skip;
> +
>      private File buildDir;
>
>
>      public void execute()
>          throws MojoExecutionException
>      {
> +
> +        if ( skip )
> +        {
> +            getLog().info( "Skipping rar generation." );
> +        }
> +

really skipping? :-)

>          getLog().debug( " ======= RarMojo settings =======" );
>          getLog().debug( "rarSourceDirectory[" + rarSourceDirectory + "]" );
>          getLog().debug( "manifestFile[" + manifestFile + "]" );
>
>



-- 
Olivier Lamy
Ecetera: http://ecetera.com.au
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org