My project has 3 maven module and they are built by nodejs script.
Now I want to integrate with Jenkin and Nexus. My Jenkin build config look like this:
I also add my maven settings.xml
in Provide configuration files build step in Build section but it didn't work. Maven still fail and could not resolve dependencies in my Nexus repo.
In my local maven settings.xml
I have added some config for Nexus repository and another repository.
Can you enlight me this case. I'm new to Jenkin.
Thanks in advance.
In the Jenkins dashboard (Home screen), click Manage Jenkins from the left-hand side menu. Then, click on 'Configure System' from the right hand side. In the Configure system screen, scroll down till you see the Maven section and then click on the 'Add Maven' button. Uncheck the 'Install automatically' option.
The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.
I just find a way to work around by adding mvn-settings.xml
directly to my folder and edit the run command like:
mvn clean install -s mvn-settings.xml
I came up with a solution combining the question and answer(both from Anh). The problem with Anh's solution to the problem was that we had to include the settings.xml which might contain credentials(in my case, it had some confidential information), which shouldn't be a part of repository(as highlighted in the comment by sigi).
This is how I avoided that risk(Step by step):
clean install -s settings.xml
Please note that the build project I created in Jenkins was as a Maven Project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With