You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2015/11/03 21:43:11 UTC

svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Author: khmarbaise
Date: Tue Nov  3 20:43:11 2015
New Revision: 1712402

URL: http://svn.apache.org/viewvc?rev=1712402&view=rev
Log:
[MSOURCES-91] Added several properties for parameters

Modified:
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java?rev=1712402&r1=1712401&r2=1712402&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java Tue Nov  3 20:43:11 2015
@@ -61,7 +61,7 @@ public abstract class AbstractSourceJarM
      *
      * @since 2.1
      */
-    @Parameter
+    @Parameter( property = "maven.source.includes" )
     private String[] includes;
 
     /**
@@ -70,7 +70,7 @@ public abstract class AbstractSourceJarM
      *
      * @since 2.1
      */
-    @Parameter
+    @Parameter( property = "maven.source.excludes" )
     private String[] excludes;
 
     /**
@@ -79,7 +79,7 @@ public abstract class AbstractSourceJarM
      *
      * @since 2.1
      */
-    @Parameter( defaultValue = "true" )
+    @Parameter( property = "maven.source.useDefaultExcludes", defaultValue = "true" )
     private boolean useDefaultExcludes;
 
     /**
@@ -119,7 +119,7 @@ public abstract class AbstractSourceJarM
      *
      * @since 2.1
      */
-    @Parameter( defaultValue = "false" )
+    @Parameter( property = "maven.source.useDefaultManifestFile", defaultValue = "false" )
     private boolean useDefaultManifestFile;
 
     /**
@@ -154,14 +154,14 @@ public abstract class AbstractSourceJarM
     /**
      * The directory where the generated archive file will be put.
      */
-    @Parameter( defaultValue = "${project.build.directory}" )
+    @Parameter( property = "maven.source.outputDirectory", defaultValue = "${project.build.directory}" )
     protected File outputDirectory;
 
     /**
      * The filename to be used for the generated archive file. For the source:jar goal, "-sources" is appended to this
      * filename. For the source:test-jar goal, "-test-sources" is appended.
      */
-    @Parameter( defaultValue = "${project.build.finalName}" )
+    @Parameter( property = "maven.source.finalName", defaultValue = "${project.build.finalName}" )
     protected String finalName;
 
     /**
@@ -411,7 +411,7 @@ public abstract class AbstractSourceJarM
     {
         try
         {
-//            archiver.addFileSet( fileSet );
+            // archiver.addFileSet( fileSet );
             archiver.addDirectory( sourceDirectory, includes, excludes );
         }
         catch ( ArchiverException e )



Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Robert Scholte <rf...@apache.org>.
Op Mon, 09 Nov 2015 22:59:26 +0100 schreef Karl Heinz Marbaise  
<kh...@gmx.de>:

> Hi Robert,
>
> On 11/9/15 10:48 PM, Robert Scholte wrote:
>> Op Mon, 09 Nov 2015 20:28:13 +0100 schreef Karl Heinz Marbaise
>> <kh...@gmx.de>:
>>
>>> Hi Robert,
>>>
>>> On 11/9/15 5:57 PM, Robert Scholte wrote:
>>>> Hi Karl-Heinz,
>>>>
>>>> properties for arrays? How would that work?
>>>
>>> mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar
>>> -Dmaven.source.includes='**/Test*.java','**/Life*.java'
>>>
>>> ...debug output:
>>>
>>> ......... (f) forceCreation = false
>>> [DEBUG]   (f) includePom = false
>>> [DEBUG]   (f) includes = [**/Test*.java, **/Life*.java]
>>
>> This is not what I expected. Sorry for not testing,
>
> no need to apologize..
>
>  > but does this work
>> for all Maven versions?
>
> Hm... good question...not tested yet...
>
> checked with Maven 3.0.5, 3.1.1, 3.2.5, 3.3.3 looks good...

I've seen a lot of documentation, but this is new for me. Good to know  
this feature.

>
>
>> And can you escape the single quote?
>
> you mean like this:
>
> mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar
> -Dmaven.source.includes=\'**/Test*.java\',\'**/Life*.java\'
>
> ?
>

yes, something like this.

>
>>>
>>> I know...but if you think this in consequence you should never add any
>>> kind of properties...for usage on command line...
>>>
>>> But i understand your point....
>>>
>>> So the real question is which of those parameters should never being
>>> changed on the command line ?
>>
>> Was there a (valid) request to expose these parameters as property, or
>> was it done because these parameters didn't had a property yet?
>
> I have done it cause the parameters didn't had a property yet...
>

in that case I don't see real added value, only options to make the build  
more complex :)

thanks,
Robert

> Kind regards
> Karl Heinz Marbaise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Robert,

On 11/9/15 10:48 PM, Robert Scholte wrote:
> Op Mon, 09 Nov 2015 20:28:13 +0100 schreef Karl Heinz Marbaise
> <kh...@gmx.de>:
>
>> Hi Robert,
>>
>> On 11/9/15 5:57 PM, Robert Scholte wrote:
>>> Hi Karl-Heinz,
>>>
>>> properties for arrays? How would that work?
>>
>> mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar
>> -Dmaven.source.includes='**/Test*.java','**/Life*.java'
>>
>> ...debug output:
>>
>> ......... (f) forceCreation = false
>> [DEBUG]   (f) includePom = false
>> [DEBUG]   (f) includes = [**/Test*.java, **/Life*.java]
>
> This is not what I expected. Sorry for not testing,

no need to apologize..

 > but does this work
> for all Maven versions?

Hm... good question...not tested yet...

checked with Maven 3.0.5, 3.1.1, 3.2.5, 3.3.3 looks good...


> And can you escape the single quote?

you mean like this:

mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar
-Dmaven.source.includes=\'**/Test*.java\',\'**/Life*.java\'

?


>>
>> I know...but if you think this in consequence you should never add any
>> kind of properties...for usage on command line...
>>
>> But i understand your point....
>>
>> So the real question is which of those parameters should never being
>> changed on the command line ?
>
> Was there a (valid) request to expose these parameters as property, or
> was it done because these parameters didn't had a property yet?

I have done it cause the parameters didn't had a property yet...

Kind regards
Karl Heinz Marbaise


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


Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Robert Scholte <rf...@apache.org>.
Op Mon, 09 Nov 2015 20:28:13 +0100 schreef Karl Heinz Marbaise  
<kh...@gmx.de>:

> Hi Robert,
>
> On 11/9/15 5:57 PM, Robert Scholte wrote:
>> Hi Karl-Heinz,
>>
>> properties for arrays? How would that work?
>
> mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar  
> -Dmaven.source.includes='**/Test*.java','**/Life*.java'
>
> ...debug output:
>
> ......... (f) forceCreation = false
> [DEBUG]   (f) includePom = false
> [DEBUG]   (f) includes = [**/Test*.java, **/Life*.java]

This is not what I expected. Sorry for not testing, but does this work for  
all Maven versions?
And can you escape the single quote?

>
>
> ..
> [INFO] --- maven-source-plugin:3.0.0-SNAPSHOT:jar (default-cli) @  
> test-maven-plugin ---
> [INFO] Building jar:  
> /Users/kama/ws-git/test-maven-plugin/target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar
>
>
> ~/ws-git/test-maven-plugin (master)$ unzip -t  
> target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar
> Archive:  target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar
>      testing: com/soebes/              OK
>      testing: com/                     OK
>      testing: META-INF/MANIFEST.MF     OK
>      testing: com/soebes/maven/        OK
>      testing: com/soebes/maven/plugins/   OK
>      testing: com/soebes/maven/plugins/tmp/   OK
>      testing: com/soebes/maven/plugins/tmp/TestMojo.java   OK
>      testing: META-INF/                OK
>      testing: com/soebes/maven/plugins/tmp/LifeCycleParticipant.java   OK
> No errors detected in compressed data of  
> target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar.
>
> Looks correct...so far....
>
>
>> IMHO not every parameter needs a property. Being able to change some
>> values by commandline could make the result unpredictable. Some values
>> are meant to be set in the pom.xml and never be changed again.
>
> I know...but if you think this in consequence you should never add any  
> kind of properties...for usage on command line...
>
> But i understand your point....
>
> So the real question is which of those parameters should never being  
> changed on the command line ?

Was there a (valid) request to expose these parameters as property, or was  
it done because these parameters didn't had a property yet?

Robert

>
>
> Kind regards
> Karl Heinz Marbaise
>
>
>>
>> regards,
>> Robert
>>
>> Op Tue, 03 Nov 2015 21:43:11 +0100 schreef <kh...@apache.org>:
>>
>>> Author: khmarbaise
>>> Date: Tue Nov  3 20:43:11 2015
>>> New Revision: 1712402
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1712402&view=rev
>>> Log:
>>> [MSOURCES-91] Added several properties for parameters
>>>
>>> Modified:
>>>
>>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>>
>>>
>>> Modified:
>>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java?rev=1712402&r1=1712401&r2=1712402&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>> (original)
>>> +++
>>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>> Tue Nov  3 20:43:11 2015
>>> @@ -61,7 +61,7 @@ public abstract class AbstractSourceJarM
>>>       *
>>>       * @since 2.1
>>>       */
>>> -    @Parameter
>>> +    @Parameter( property = "maven.source.includes" )
>>>      private String[] includes;
>>>     /**
>>> @@ -70,7 +70,7 @@ public abstract class AbstractSourceJarM
>>>       *
>>>       * @since 2.1
>>>       */
>>> -    @Parameter
>>> +    @Parameter( property = "maven.source.excludes" )
>>>      private String[] excludes;
>>>     /**
>>> @@ -79,7 +79,7 @@ public abstract class AbstractSourceJarM
>>>       *
>>>       * @since 2.1
>>>       */
>>> -    @Parameter( defaultValue = "true" )
>>> +    @Parameter( property = "maven.source.useDefaultExcludes",
>>> defaultValue = "true" )
>>>      private boolean useDefaultExcludes;
>>>     /**
>>> @@ -119,7 +119,7 @@ public abstract class AbstractSourceJarM
>>>       *
>>>       * @since 2.1
>>>       */
>>> -    @Parameter( defaultValue = "false" )
>>> +    @Parameter( property = "maven.source.useDefaultManifestFile",
>>> defaultValue = "false" )
>>>      private boolean useDefaultManifestFile;
>>>     /**
>>> @@ -154,14 +154,14 @@ public abstract class AbstractSourceJarM
>>>      /**
>>>       * The directory where the generated archive file will be put.
>>>       */
>>> -    @Parameter( defaultValue = "${project.build.directory}" )
>>> +    @Parameter( property = "maven.source.outputDirectory",
>>> defaultValue = "${project.build.directory}" )
>>>      protected File outputDirectory;
>>>     /**
>>>       * The filename to be used for the generated archive file. For
>>> the source:jar goal, "-sources" is appended to this
>>>       * filename. For the source:test-jar goal, "-test-sources" is
>>> appended.
>>>       */
>>> -    @Parameter( defaultValue = "${project.build.finalName}" )
>>> +    @Parameter( property = "maven.source.finalName", defaultValue =
>>> "${project.build.finalName}" )
>>>      protected String finalName;
>>>     /**
>>> @@ -411,7 +411,7 @@ public abstract class AbstractSourceJarM
>>>      {
>>>          try
>>>          {
>>> -//            archiver.addFileSet( fileSet );
>>> +            // archiver.addFileSet( fileSet );
>>>              archiver.addDirectory( sourceDirectory, includes,
>>> excludes );
>>>          }
>>>          catch ( ArchiverException e )
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Robert,

On 11/9/15 5:57 PM, Robert Scholte wrote:
> Hi Karl-Heinz,
>
> properties for arrays? How would that work?

mvn  org.apache.maven.plugins:maven-source-plugin:3.0.0-SNAPSHOT:jar 
-Dmaven.source.includes='**/Test*.java','**/Life*.java'

...debug output:

......... (f) forceCreation = false
[DEBUG]   (f) includePom = false
[DEBUG]   (f) includes = [**/Test*.java, **/Life*.java]


..
[INFO] --- maven-source-plugin:3.0.0-SNAPSHOT:jar (default-cli) @ 
test-maven-plugin ---
[INFO] Building jar: 
/Users/kama/ws-git/test-maven-plugin/target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar


~/ws-git/test-maven-plugin (master)$ unzip -t 
target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar
Archive:  target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar
     testing: com/soebes/              OK
     testing: com/                     OK
     testing: META-INF/MANIFEST.MF     OK
     testing: com/soebes/maven/        OK
     testing: com/soebes/maven/plugins/   OK
     testing: com/soebes/maven/plugins/tmp/   OK
     testing: com/soebes/maven/plugins/tmp/TestMojo.java   OK
     testing: META-INF/                OK
     testing: com/soebes/maven/plugins/tmp/LifeCycleParticipant.java   OK
No errors detected in compressed data of 
target/test-maven-plugin-0.1.0-SNAPSHOT-sources.jar.

Looks correct...so far....


> IMHO not every parameter needs a property. Being able to change some
> values by commandline could make the result unpredictable. Some values
> are meant to be set in the pom.xml and never be changed again.

I know...but if you think this in consequence you should never add any 
kind of properties...for usage on command line...

But i understand your point....

So the real question is which of those parameters should never being 
changed on the command line ?


Kind regards
Karl Heinz Marbaise


>
> regards,
> Robert
>
> Op Tue, 03 Nov 2015 21:43:11 +0100 schreef <kh...@apache.org>:
>
>> Author: khmarbaise
>> Date: Tue Nov  3 20:43:11 2015
>> New Revision: 1712402
>>
>> URL: http://svn.apache.org/viewvc?rev=1712402&view=rev
>> Log:
>> [MSOURCES-91] Added several properties for parameters
>>
>> Modified:
>>
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>
>>
>> Modified:
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>
>> URL:
>> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java?rev=1712402&r1=1712401&r2=1712402&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>> (original)
>> +++
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>> Tue Nov  3 20:43:11 2015
>> @@ -61,7 +61,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter
>> +    @Parameter( property = "maven.source.includes" )
>>      private String[] includes;
>>     /**
>> @@ -70,7 +70,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter
>> +    @Parameter( property = "maven.source.excludes" )
>>      private String[] excludes;
>>     /**
>> @@ -79,7 +79,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter( defaultValue = "true" )
>> +    @Parameter( property = "maven.source.useDefaultExcludes",
>> defaultValue = "true" )
>>      private boolean useDefaultExcludes;
>>     /**
>> @@ -119,7 +119,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter( defaultValue = "false" )
>> +    @Parameter( property = "maven.source.useDefaultManifestFile",
>> defaultValue = "false" )
>>      private boolean useDefaultManifestFile;
>>     /**
>> @@ -154,14 +154,14 @@ public abstract class AbstractSourceJarM
>>      /**
>>       * The directory where the generated archive file will be put.
>>       */
>> -    @Parameter( defaultValue = "${project.build.directory}" )
>> +    @Parameter( property = "maven.source.outputDirectory",
>> defaultValue = "${project.build.directory}" )
>>      protected File outputDirectory;
>>     /**
>>       * The filename to be used for the generated archive file. For
>> the source:jar goal, "-sources" is appended to this
>>       * filename. For the source:test-jar goal, "-test-sources" is
>> appended.
>>       */
>> -    @Parameter( defaultValue = "${project.build.finalName}" )
>> +    @Parameter( property = "maven.source.finalName", defaultValue =
>> "${project.build.finalName}" )
>>      protected String finalName;
>>     /**
>> @@ -411,7 +411,7 @@ public abstract class AbstractSourceJarM
>>      {
>>          try
>>          {
>> -//            archiver.addFileSet( fileSet );
>> +            // archiver.addFileSet( fileSet );
>>              archiver.addDirectory( sourceDirectory, includes,
>> excludes );
>>          }
>>          catch ( ArchiverException e )
>>

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


Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Anders Hammar <an...@hammar.net>.
I second Robert comment here on not having everything configurable from
command line. It's not always good as the build will not be reproducible.

/Anders

On Mon, Nov 9, 2015 at 5:57 PM, Robert Scholte <rf...@apache.org> wrote:

> Hi Karl-Heinz,
>
> properties for arrays? How would that work?
> IMHO not every parameter needs a property. Being able to change some
> values by commandline could make the result unpredictable. Some values are
> meant to be set in the pom.xml and never be changed again.
>
> regards,
> Robert
>
> Op Tue, 03 Nov 2015 21:43:11 +0100 schreef <kh...@apache.org>:
>
> Author: khmarbaise
>> Date: Tue Nov  3 20:43:11 2015
>> New Revision: 1712402
>>
>> URL: http://svn.apache.org/viewvc?rev=1712402&view=rev
>> Log:
>> [MSOURCES-91] Added several properties for parameters
>>
>> Modified:
>>
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>>
>> Modified:
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>> URL:
>> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java?rev=1712402&r1=1712401&r2=1712402&view=diff
>>
>> ==============================================================================
>> ---
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>> (original)
>> +++
>> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>> Tue Nov  3 20:43:11 2015
>> @@ -61,7 +61,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter
>> +    @Parameter( property = "maven.source.includes" )
>>      private String[] includes;
>>     /**
>> @@ -70,7 +70,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter
>> +    @Parameter( property = "maven.source.excludes" )
>>      private String[] excludes;
>>     /**
>> @@ -79,7 +79,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter( defaultValue = "true" )
>> +    @Parameter( property = "maven.source.useDefaultExcludes",
>> defaultValue = "true" )
>>      private boolean useDefaultExcludes;
>>     /**
>> @@ -119,7 +119,7 @@ public abstract class AbstractSourceJarM
>>       *
>>       * @since 2.1
>>       */
>> -    @Parameter( defaultValue = "false" )
>> +    @Parameter( property = "maven.source.useDefaultManifestFile",
>> defaultValue = "false" )
>>      private boolean useDefaultManifestFile;
>>     /**
>> @@ -154,14 +154,14 @@ public abstract class AbstractSourceJarM
>>      /**
>>       * The directory where the generated archive file will be put.
>>       */
>> -    @Parameter( defaultValue = "${project.build.directory}" )
>> +    @Parameter( property = "maven.source.outputDirectory", defaultValue
>> = "${project.build.directory}" )
>>      protected File outputDirectory;
>>     /**
>>       * The filename to be used for the generated archive file. For the
>> source:jar goal, "-sources" is appended to this
>>       * filename. For the source:test-jar goal, "-test-sources" is
>> appended.
>>       */
>> -    @Parameter( defaultValue = "${project.build.finalName}" )
>> +    @Parameter( property = "maven.source.finalName", defaultValue =
>> "${project.build.finalName}" )
>>      protected String finalName;
>>     /**
>> @@ -411,7 +411,7 @@ public abstract class AbstractSourceJarM
>>      {
>>          try
>>          {
>> -//            archiver.addFileSet( fileSet );
>> +            // archiver.addFileSet( fileSet );
>>              archiver.addDirectory( sourceDirectory, includes, excludes );
>>          }
>>          catch ( ArchiverException e )
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java

Posted by Robert Scholte <rf...@apache.org>.
Hi Karl-Heinz,

properties for arrays? How would that work?
IMHO not every parameter needs a property. Being able to change some  
values by commandline could make the result unpredictable. Some values are  
meant to be set in the pom.xml and never be changed again.

regards,
Robert

Op Tue, 03 Nov 2015 21:43:11 +0100 schreef <kh...@apache.org>:

> Author: khmarbaise
> Date: Tue Nov  3 20:43:11 2015
> New Revision: 1712402
>
> URL: http://svn.apache.org/viewvc?rev=1712402&view=rev
> Log:
> [MSOURCES-91] Added several properties for parameters
>
> Modified:
>     maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
>
> Modified:  
> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
> URL:  
> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java?rev=1712402&r1=1712401&r2=1712402&view=diff
> ==============================================================================
> ---  
> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java  
> (original)
> +++  
> maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java  
> Tue Nov  3 20:43:11 2015
> @@ -61,7 +61,7 @@ public abstract class AbstractSourceJarM
>       *
>       * @since 2.1
>       */
> -    @Parameter
> +    @Parameter( property = "maven.source.includes" )
>      private String[] includes;
>     /**
> @@ -70,7 +70,7 @@ public abstract class AbstractSourceJarM
>       *
>       * @since 2.1
>       */
> -    @Parameter
> +    @Parameter( property = "maven.source.excludes" )
>      private String[] excludes;
>     /**
> @@ -79,7 +79,7 @@ public abstract class AbstractSourceJarM
>       *
>       * @since 2.1
>       */
> -    @Parameter( defaultValue = "true" )
> +    @Parameter( property = "maven.source.useDefaultExcludes",  
> defaultValue = "true" )
>      private boolean useDefaultExcludes;
>     /**
> @@ -119,7 +119,7 @@ public abstract class AbstractSourceJarM
>       *
>       * @since 2.1
>       */
> -    @Parameter( defaultValue = "false" )
> +    @Parameter( property = "maven.source.useDefaultManifestFile",  
> defaultValue = "false" )
>      private boolean useDefaultManifestFile;
>     /**
> @@ -154,14 +154,14 @@ public abstract class AbstractSourceJarM
>      /**
>       * The directory where the generated archive file will be put.
>       */
> -    @Parameter( defaultValue = "${project.build.directory}" )
> +    @Parameter( property = "maven.source.outputDirectory", defaultValue  
> = "${project.build.directory}" )
>      protected File outputDirectory;
>     /**
>       * The filename to be used for the generated archive file. For the  
> source:jar goal, "-sources" is appended to this
>       * filename. For the source:test-jar goal, "-test-sources" is  
> appended.
>       */
> -    @Parameter( defaultValue = "${project.build.finalName}" )
> +    @Parameter( property = "maven.source.finalName", defaultValue =  
> "${project.build.finalName}" )
>      protected String finalName;
>     /**
> @@ -411,7 +411,7 @@ public abstract class AbstractSourceJarM
>      {
>          try
>          {
> -//            archiver.addFileSet( fileSet );
> +            // archiver.addFileSet( fileSet );
>              archiver.addDirectory( sourceDirectory, includes, excludes  
> );
>          }
>          catch ( ArchiverException e )
>

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