0
votes

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
Why do you want to change the global settings.xml? Usually, you only change the one in .m2.J Fabian Meier
Why does it fail download the repositories because... ?khmarbaise
Because I can change the 'M2_HOME' env variable which contains the directory under 'Program Files' but I think there's no variable for the .m2-Folder. I want to change settings.xml files via environment variablesFelix Schildmann
The download fails because it tries to download from the standard Maven repository but the required dependencies are in my custom repositoryFelix Schildmann

1 Answers

0
votes

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.