We have a remote repository in our organization ( JFROG ) and we use eclipse for Java development. We work on multiple POC projects and need to connect to Maven central repository.
Once we have finished POC and are ready with required dependencies, we provide the POM to Jfrog team to download, scan and index in Jfrog. Then we test again connecting to Jfrog to make sure build is smooth and libraries are being used only from Jfrog remote repository. Our nightly build boxes have only access to JFROG.
We want our local repository folder to be separate when downloading from maven and when downloading from Jfrog.
Please provide an easiest way to switch and tell maven to use different local repository. We have repositories, proxy, servers .. etc settings ready.
These are the different ways I tried.
Created 2 profiles and provided -PJfrog parameter when invoking mvn. I added property maven.repo.local in properties and this did not help
<id>jfrog</id> <properties> <maven.repo.local>C:/Maven-3.6.3/repository_jfrog</maven.repo.local> </properties>
I manually provided mvn -PJfrog -Dmaven.repo.local="C:/Maven-3.6.3/repository_jfrog". This worked but seems not easiest. I wanted it to be as simple as adding Active profile in Eclipse or adding -PJfrog in cmd line
- Have 2 different settings.xml. Default settings.xml and settings_jfrog.xml. Here I can provide different folders paths for localRepository tag . This worked but I have to change the settings.xml location in Eclipse Window -> preferences -> Maven -> User Settings.
Also in command prompt, I have to provide specific settings.xml. I have no idea if this is the only and best way or if I a missing some other ways.
mvn -gs C:\Maven-3.6.3\settings_Jfrog.xml clean install