In my maven ~./.m2/settings.xml I have defined a mirror and some repositories:
<mirrors>
<mirror>
<id>someid</id>
.....
</mirro>
</mirrors>
...
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository> <id>repo....</id>
....
</profile>
</profiles>
This works fine.
There are some projects where I want do disable the mirror and the default profile. I know that i can define a seperate profile for the repositories, but i don't know how I can tell the maven eclipse plugin not to use the default profile or a specific profile. Also: how can I change the mirror for a project?
You can force Maven to use a single repository by having it mirror all repository requests. The repository must contain all of the desired artifacts, or be able to proxy the requests to other repositories.
By default, Maven will download from the central repository. To override this, you need to specify a mirror as shown in Using Mirrors for Repositories. You can set this in your settings. xml file to globally use a certain mirror.
The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.
Unfortunately this is impossible with single settings.xml. There is feature request in Maven JIRA, vote for this!
Workaround is to have two settings.xml and running maven with selected configuration:
mvn -s my-settings.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With