Not sure I get what your actual issue is. Could you maybe rephrase it to say what you see, compared to what you expect, and provide the error logs and so on?
Cheers Le 17 août 2016 11:02 AM, "Tony Murphy" <tomur...@gmail.com> a écrit : > Hi > > I'm using the new Jenkins Pipelines and I need some help. > > I was under the illusion that once I setup my multi branch pipeline that > was it as far as checkouts and branch management was concerned. But it > seems that I was mistaken. > > I had issues where for example mvn command was not running in the > directory were the code was checkout out to. The command seemed to be > running in a <branch_name> folder, while the code was in a sibling folder > with a <branch_name>@scripts name (hope that makes sense) > > `checkout scm` does not work for me btw > > I would be grateful if someone could confirm I'm on the right track, could > suggest improvements or confirm that it won't always be like this :) > > #!groovy > > githubCredentials = 'github_credentials' > def projectBranch = "${env.BRANCH_NAME}" > > node { > > def javaHome = tool "java8" // ensure Java 8 is installed > def projectRepoURL = 'g...@github.com:tonymurphy/jenkins-test.git' > echo "${env.getEnvironment()}" > def mvnHome = tool "mvn-3.2.2" > > wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) { > > stage "Checkout" > sh("git config --global credential.helper cache") > checkout([$class : 'GitSCM', > branches : [[name: projectBranch]], > extensions : [[$class: 'RelativeTargetDirectory', > relativeTargetDir: 'jenkins-test'], [$class: 'CheckoutOption', timeout: > 100000]], > userRemoteConfigs: [[credentialsId: githubCredentials, url: > projectRepoURL]]]) > > stage 'Build' > withEnv(["PATH+ACTIVATOR=${tool 'activator-1.3.x'}", > "PATH+JDK=${javaHome}/bin", "JAVA_HOME=${javaHome}"]) { > dir("jenkins-test") { > sh "${mvnHome}/bin/mvn clean compile test " > step([$class: 'ArtifactArchiver', artifacts: > '**/target/*.jar', fingerprint: true]) > step([$class: 'JUnitResultArchiver', testResults: > '**/target/surefire-reports/TEST-*.xml']) > > } > } > } > } > > Thanks! > > -- > 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 jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jenkinsci-users/CAORQRkVZKg0fh4oqcgi8CQKhfpJ6B > GnBoHijP55xv1SUR2VF6A%40mail.gmail.com > <https://groups.google.com/d/msgid/jenkinsci-users/CAORQRkVZKg0fh4oqcgi8CQKhfpJ6BGnBoHijP55xv1SUR2VF6A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS64ZCkH6YEeNmTcKL%2BE9b8nqCtY9nUK4kb%2BuqONtrqQ9w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.