Mukun
Mukun

Reputation: 1816

jenkins maven repository configuration

I am new to maven and Jenkins, I am trying to build a maven 3 project. I have maven in c drive and I moved the repository to d drive. But when I configure a build in Jenkins, it is creating its own repository(I think so) Now How to configure jenkis, so that it can use my repository in D drive.

Hope I made sense.

Upvotes: 5

Views: 25945

Answers (2)

Balakumar PG
Balakumar PG

Reputation: 86

you need to adjust the settings.xml to point out which repository to use.

<localRepository>C:\\USER_LOCAL_DIR\.m2\m2repository</localRepository>

where USER_LOCAL_DIR is your user directory (e.g. Users\your_user_name).

Further more you should make sure which settings.xml the maven is using, if you dont have any specific user settings.xml the maven will start using the settings.xml which is at maven configuration directory, which will be M2_HOME/conf/settings.xml (M2_HOME being the Maven home directory). The hierarchy for settings.xml is first the user .m2 directory and if it could not find that, it will try to find the one in M2_HOME/conf/settings.xml.

Hope this helps.

Upvotes: 7

Santhosh_Reddy
Santhosh_Reddy

Reputation: 274

You may need to check for settings.xml file under

  1. ..\maven-xx\conf\settings.xml file
  2. C:\Users\Username.m2\settings.xml file

You may need to remember precedence in the order mentioned. In case if you need to point to a private maven repository consider to check both the files and in case if it's not pointing to intended location then update the settings file accordingly.

Upvotes: 0

Related Questions