A Pipeline example you can use to reproduce this problem is given below. You might adjust it a bit in order to fit your environment:
- withMaven step needs to be adjusted
- agent label we are using for our slaves is large so you might want to change that accordingly
pipeline {
agent {
label 'large'
}
options {
ansiColor('xterm')
timestamps()
timeout(time: 4, unit: 'HOURS')
}
stages {
stage('Preparation') {
steps {
script {
// for display purposes
// Get some code from a GitHub repository
git 'https://github.com/jglick/simple-maven-project-with-tests.git'
}
}
}
stage('Build') {
steps {
script {
// Run the maven build
withMaven(
mavenLocalRepo: '.repository',
mavenSettingsConfig: 'tool-maven-ro',
jdk: 'sapjvm-8',
publisherStrategy: 'EXPLICIT',
options: [
artifactsPublisher(disabled: false),
dependenciesFingerprintPublisher(disabled: false),
junitPublisher(disabled: false)
]
) {
sh 'mvn -Dmaven.test.failure.ignore clean package'
}
}
}
}
stage('Results') {
steps {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.jar'
}
}
}
}
Log snippet from master looks like this:
11:25:04 Seen branch in repository origin/master
11:25:04 Seen 1 remote branch
11:25:04 > git show-ref --tags -d # timeout=10
11:25:04 Checking out Revision fbe787fbf5b8fce670b4401b2d348ff7a4357160 (origin/master)
11:25:04 > git config core.sparsecheckout # timeout=10
11:25:04 > git checkout -f fbe787fbf5b8fce670b4401b2d348ff7a4357160
11:25:04 Commit message: "first commit"
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] script
[Pipeline] {
[Pipeline] withMaven
11:25:04 [withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], JunitTestsPublisher[disabled=false,healthScaleFactor=,keepLongStdio=false,ignoreAttachments=false]]
11:25:04 [withMaven] Available options:
11:25:04 [withMaven] using JDK installation sapjvm-8
11:25:04 $ /bin/sh -c "which mvn"
11:25:04 [withMaven] using Maven installation provided by the build agent with executable /usr/local/bin/mvn
[Pipeline] {
[Pipeline] sh
11:25:05 + mvn -Dmaven.test.failure.ignore clean package
11:25:05 ----- withMaven Wrapper script -----
11:25:05 Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
11:25:05 Maven home: /usr/local/maven
11:25:05 Java version: 1.8.0_77, vendor: SAP AG, runtime: /usr/lib/jvm/sapjvm_8/jre
11:25:05 Default locale: en_US, platform encoding: ANSI_X3.4-1968
11:25:05 OS name: "linux", version: "4.14.138+", arch: "amd64", family: "unix"
11:25:05 [INFO] [jenkins-event-spy] Generate /srv/jenkins/workspace/test pipeline@tmp/withMaven3fe3ef73/maven-spy-20191015-092505-8403902332112577080839.log.tmp ...
11:25:06 [INFO] Scanning for projects...
11:25:06 [INFO]
11:25:06 [INFO] ----------------< test:simple-maven-project-with-tests >----------------
11:25:06 [INFO] Building simple-maven-project-with-tests 1.0-SNAPSHOT
11:25:06 [INFO] --------------------------------[ jar ]---------------------------------
Same log snipped when pipeline is executed on slave looks line this:
Checking out Revision fbe787fbf5b8fce670b4401b2d348ff7a4357160 (origin/master)
Commit message: "first commit"
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] script
[Pipeline] {
[Pipeline] withMaven
[withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=false], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=false, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], JunitTestsPublisher[disabled=false,healthScaleFactor=,keepLongStdio=false,ignoreAttachments=false]]
[withMaven] Available options:
[withMaven] using JDK installation sapjvm-8
$ /bin/sh -c "which mvn"
[withMaven] using Maven installation provided by the build agent with executable /usr/bin/mvn
[Pipeline] {
[Pipeline] sh
+ mvn -Dmaven.test.failure.ignore clean package
----- withMaven Wrapper script -----
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277"
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T15:06:16Z)
Maven home: /usr/share/maven
Java version: 1.8.0_221, vendor: SAP AG, runtime: /usr/lib/jvm/sapjvm_8/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.14.138+", arch: "amd64", family: "unix"
Seen branch in repository origin/master
Seen 1 remote branch
> git show-ref --tags -d # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f fbe787fbf5b8fce670b4401b2d348ff7a4357160
[INFO] [jenkins-event-spy] Generate /var/lib/jenkins/workspace/test pipeline@tmp/withMaven805d1277/maven-spy-20191015-093038-6193675996080952171854.log.tmp ...
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< test:simple-maven-project-with-tests >----------------
[INFO] Building simple-maven-project-with-tests 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
|