Maven doesn't use the repository from the global settings.xml

548 Views Asked by At

I have set up an active profile with custom repositories in my "\Program Files\maven\conf" directory but Maven always tries to use the standard URL (repo.maven.apache.org/maven2) and fails to download the repositories because of that. I already tried to debug the process and the correct settings.xml is loaded as 'globalSettings' but it doesn't want to use my custom repositories.

If I add the profiles + repos to the settings.xml in my ".m2"-folder the download works. How can I force Maven to use the custom URL instead of the "repo.maven.apache.org" one?

1

There are 1 best solutions below

0
On

The standard way to use different settings.xml is to use the -s parameter on command line.

You can use a bat file to set this parameter through environment variables if you want.