I have defined a custom maven setting.xml which resides in the root directory of the repository, however when I am executing the pipeline which has this command: "- mvn -B -s settings.xml clean install", it is not referring to the custom settings.xml file. Any suggestions, what could be the issue?
Hello @Mukesh Mehta and welcome to the Community!
When a pipeline build starts the repository is cloned into the build container and the build starts in the root directory of the cloned repository. By any chance are you changing the directory during your build, like executing a cd <new directory path>?
Also, since you mentioned the file settings.xml was committed to the root of your repository, I would suggest listing the files during your pipeline to confirm if the file is indeed there :
ls -la
You can add this command to your step's script before the mvn command.
If that still does not work, I would suggest trying to debug the build locally using docker following the instructions of Debug pipelines locally with docker as this seems to be an error with the maven config itself. Once it successfully runs locally, you can push the changes to the bitbucket repository and the pipeline should produce the same result.
Thank you, @Mukesh Mehta !
Patrik S
Hi Pratik,
Thanks a lot for suggesting the solution. I tried debugging locally and found a problem with maven config. I was able to fix the config and it is working fine now.
Thank you,
Mukesh Mehta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.