maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte" <rfscho...@apache.org>
Subject Re: svn commit: r1712402 - /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java
Date Mon, 09 Nov 2015 21:48:55 GMT
Op Mon, 09 Nov 2015 20:28:13 +0100 schreef Karl Heinz Marbaise  
<khmarbaise@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 <khmarbaise@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


Mime
View raw message