Open sklein94 opened 4 years ago
@sklein94 thanks for reporting.
I stumbled upon this issue before. Not with maven but with dir
and docker
.
My solution was to explicitly mount the whole Jenkins workspace into the container.
docker.image('someImg')
.inside("-v ${env.WORKSPACE}:${env.WORKSPACE}") {
//...
}
We could apply this to MavenInDocker
in general. Do you think this would solve your issue?
You can try it out in a replay. Just set the following
String runArgs = "-v ${env.WORKSPACE}:${env.WORKSPACE} "
@schnatterer Thank you for your response. Yes, this sounds good and should solve my issue!
I had a problem building a maven project which was using the maven scm plugin. I was using the MavenInDocker-class to build the project.
The maven project is inside of a subfolder in the main project. So i was using the
dir
block in my Jenkinsfile. The problem is, that in this case only the current dir was mounted into the maven-docker-container which caused the build to fail because the.git
-folder in the parent folder is required when using the scm-plugin.To bypass this i executed the maven build in the base directory (to make sure everything is mounted inside docker) and passed the path to the pom.xml into the additionalArgs of the maven object.
Can you please make sure that the whole project is mounted into the maven-in-docker-container? Maybe there is also another way, but i dont have an idea.