Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

327
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda