How to Use a Maven settings.xml from outside the local repository
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
If you intend to reference files (e.g. settings.xml)
for Maven that are located in a separate directory or repository, you will need to use Maven arguments to reference them.
Solution
If you are using a settings.xml from a different local directory
Edit your Job in
Builds >> All Build Plans >> Build name >> Actions >> Configure Build
In your Maven Task, add the relative path to the beginning of the Goal field
eg: -s
maven-settings-dir/settings.xml
Save the Task
If you are pulling settings.xml from a different repository
You may have your settings.xml
in a different repository that you want to pull in during the build. You can get settings.xml
as follows:
Link the other repository, if needed
Edit your Job in
Builds >> All Build Plans >> Build name >> Actions >> Configure Build
Add a new Source Code Checkout task before the Maven task
Select your other repository as the Repository for the task
Add a Checkout Directory (it will be added if it doesn't exist) and save
eg: maven-settings-dir
In your Maven Task, add the relative path to the beginning of the Goal field and save
eg: -s
maven-settings-dir/settings.xml
If you have any questions about this process, please reach out to Atlassian Support
Was this helpful?