Thanks for inspiration, Victor!

For the record, I was mentioning a part of "Configure Jenkins" page, which 
turns out to probably be a part of maven-plugin. Currently it's located 
right above the master node config (# of executors, etc.)

The YAML config for CasC should look similar to this:

# "Maven Project Configuration" section
mavenmoduleset:
  globalMavenOpts: "some opts"
  localRepository:
    perJob:  # alternatives: default, perExecutor


Now I haven't yet successfully managet to get the plugin to work, but it is 
possible to do the same as Groovy init:

import hudson.maven.MavenModuleSet;
import hudson.maven.local_repo.*;

/*
 * Possible classes of the hudson.maven.local_repo package:
 * - DefaultLocalRepositoryLocator
 * - PerExecutorLocalRepositoryLocator
 * - PerJobLocalRepositoryLocator
 */

def mvnModuleSetDesc = MavenModuleSet.DESCRIPTOR;
mvnModuleSetDesc.setGlobalMavenOpts("Some options")
mvnModuleSetDesc.setLocalRepository(new PerJobLocalRepositoryLocator())

On Friday, November 9, 2018 at 8:15:20 PM UTC+1, Victor Martinez wrote:
>
> I'd rather suggest to look at:
> - https://github.com/jenkinsci/configuration-as-code-plugin
>
>
> I'm not sure where the "Maven Project Configuration" section is but 
> something like the below snippet might help to configure the maven tools 
> globally:
>
> tool:
>   maven: # (4)
>     installations:
>     - name: "maven"
>       properties:
>       - installSource:
>           installers:
>           - maven:
>               id: "3.5.4"
>
> Cheers
>

-- 
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/d87b2f20-9487-4039-bade-848b5944e5d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to