Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50662

withMaven for declarative pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      For declarative pipelines, the tools can be selected on a job-basis, in the tools section, https://jenkins.io/doc/book/pipeline/syntax/#tools:

      pipeline {
        agent {
          label 'docker'
        }
        tools {
          jdk 'Oracle-JDK8-64bit' <-- JDK
          maven 'apache-maven-3.x' <-- maven
        }
      

      But there are some nice features for the withMaven as well (such as flags for reports, setting the maven repo location). It would be nice if withMaven could use what has been declared in the tools section, so it need not be redefined for each maven execution.

      [Pipeline] withMaven
      11:43:50 [withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher[disabled=false]]
      11:43:50 [withMaven] Available options: 
      11:43:50 [withMaven] use JDK installation provided by the build agent <-- pick up from tools section
      11:43:50 [withMaven] use Maven installation 'apache-maven-3.5.x' <-- pick up from tools section
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              alobato Alvaro Lobato
              Reporter:
              davidkarlsen davidkarlsen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: