• Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • pipeline-maven-plugin
    • None
    • Jenkins 2.204.5
      Pipeline Maven Integration Plugin 3.8.2

      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
      

          [JENKINS-50662] withMaven for declarative pipeline

          davidkarlsen created issue -
          Benjamin Brummer made changes -
          Environment New: Jenkins 2.204.5
          Pipeline Maven Integration Plugin 3.8.2
          Arnaud Héritier made changes -
          Assignee Original: Alvaro Lobato [ alobato ]
          Benoit made changes -
          Link New: This issue duplicates JENKINS-68235 [ JENKINS-68235 ]
          Benoit made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            davidkarlsen davidkarlsen
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: