Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
How to manage different maven setting in eclipse for different projects?

I am working on two different projects, Both uses different maven .settings.xml files.
When I switch between the projects, it re downloads all the maven dependencies in repository folder removing previous projects' dependencies.
Is there any way I can use two settings and it maintains different repository for both projects.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can try to separate the two projects in different workspaces and you can configure each workspace with eclipse, it is possible because eclipse saves the configuration within each workspace, so you can specify the different repositories with their maven settings.xml files.

For to do that, launch eclipse > go to preferences > choose maven > User Settings and click on "Update Settings"

enter image description here

UPDATE:

You should have a structure similar to the following:

Workspaces:

/Volumes/Stonehall/juanca/workspace-project-1/
/Volumes/Stonehall/juanca/workspace-project-2/

Repositories:

/Volumes/Stonehall/juanca/.m2/settings-project-1.xml
/Volumes/Stonehall/juanca/.m2/settings-project-2.xml

Open and edit settings-project-1.xml file. Searchs the localRepository tag and replace the path, for example:

<localRepository>/Volumes/Stonehall/juanca/.m2/repository-1/</localRepository>

Open and edit settings-project-2.xml file. Searchs the localRepository tag and replace with the other path, for example:

<localRepository>/Volumes/Stonehall/juanca/.m2/repository-2/</localRepository>

Important: checks that the <localRepository> tag is not commented for example:

<!--
...
<localRepository>/Volumes/Stonehall/juanca/.m2/repository/</localRepository>
-->

Eclipse:

Open the workspace-project-1, go to preferences > choose maven > User Settings and click on "Update Settings" and replace with the new path:

/Volumes/Stonehall/juanca/.m2/settings-project-1.xml

The same way you should do for the workspace-project-2, open the workspace-project-2 and go to preferences > choose maven > User Settings and click on "Update Settings" and replace with the other path:

/Volumes/Stonehall/juanca/.m2/settings-project-2.xml

With this configuration each project should download the dependencies in the differents repositories.

This configuration should work, but in case does not work, you should post your settings.xml file and the pom files of both projects, so that we can help you better

about 4 years ago · Santiago Trujillo Report

0

You can create 2 separate workspaces in Eclipse. In each workspaces, you can provide respective settings.xml file

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!