Note: Mark Lagendijk proposed a hierarchical approach for options in 
JENKINS-43596 <https://issues.jenkins-ci.org/browse/JENKINS-43596>. It is a 
bit more sophisticated, more standardized ... but a bit more verbose than 
what we tried in my previous post


*Hierarchical & standardized model*

withMaven(

   maven: 'maven-3.3.9', 
   mavenSettingsConfig: 'maven-settings-for-gameoflife',
   options: [
     artifactReporter: [
       disabled: true // default = false     ],
     someOtherReporter: [
       options: [] // whatever options this reporter accepts     ] 
   ]
) {


   sh "mvn package"

}


*Flat & not-standardized model*

withMaven(

   maven: 'maven-3.3.9', 
   mavenSettingsConfig: 'maven-settings-for-gameoflife',
   options: [
     skipArchiveGeneratedArtifacts: true, 
     fingerprintDependenciesExclude: "org.springframework.*" 
   ]
) {


   sh "mvn package"

}






On Friday, May 12, 2017 at 11:25:41 AM UTC+2, Cyrille Le Clerc wrote:
>
> Idea discussed with Alvaro Lobato: introduce an "options" Map<String, 
> Object> as a parameter of withMaven(). We will also make these options 
> configurable at the Jenkins global level then at the folder level. 
>
> See sample below
>
> node {
>     stage ("build") {
>         git "https://github.com/spring-projects/spring-petclinic.git";
>         withMaven(
>             maven: 'maven-3.3.9', 
>             mavenSettingsConfig: 'maven-settings-for-gameoflife',
>             options: [
>                 skipArchiveGeneratedArtifacts: true, 
>                 fingerprintDependenciesExclude: "org.springframework.*"]
>             ) {
>             sh "mvn clean package"
>         }
>     }
> }
>
>
>
> On Friday, April 14, 2017 at 12:37:40 PM UTC+2, Cyrille Le Clerc wrote:
>>
>> Hello Valentina,
>>
>> We are going to look at this soon.
>>
>> We have requests to have a more elegant solution to disable reporters 
>> (see JENKINS-43596 Add withMaven options for skipping 
>> <https://issues.jenkins-ci.org/browse/JENKINS-43596>).
>> We don't know yet what would be the right syntax to add configuration 
>> flags that could be consumed by the withMaven step itself or by reporters 
>> (JUnit, archiver, FindBugs, Task Scanner...).
>>
>> Cyrille
>>
>>
>> On Wednesday, March 22, 2017 at 11:13:23 AM UTC+1, Valentina Armenise 
>> wrote:
>>>
>>> Hi,
>>>
>>> I'd like to customize the withMaven  step from the Pipeline Maven 
>>> Plugin to take as input the parameters which you would normally pass to a 
>>> publisher. Specifically I'd like to be able to do something like
>>>
>>> step([$class: 'FindBugsPublisher', canRunOnFailed: true, defaultEncoding: 
>>> 'UTF-8', excludePattern: '', healthy: '', includePattern: '', pattern: 
>>> '**/target/findbugsXml.xml', shouldDetectModules: true, unHealthy: '', 
>>> unstableTotalAll: '0', useStableBuildAsReference : true])
>>>
>>>
>>> In order to define the thresholds or other things..
>>>
>>>
>>> Looking at the code, does not seem to be possible today. Is it correct?
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e7b7a2c1-067c-487a-945b-53df9babc97b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to