I have setup a pipeline with one task mvn clean package in Go CD. I have registered an agent with Java and Maven up and running. When I trigger the pipeline, the job fails:
[go] Task: mvn clean package took: 0.14s Error happened while attempting to execute 'mvn clean package'. Please make sure [mvn] can be executed on this agent.
[Debug Information] Environment variable PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-openjdk/bin
I have tried all solutions provided on the below post-but nothing works Can't execute "mvn clean package" task in GO CD
I encountered the same problem, If i execute docker exec -it gocd-agent bash and execute mvn --version,will not tip me error but if i execute docker exec -it gocd-agent sh,will tip me "mvn: command not found" so i feel the problem is bash and sh 'difference.