I have the following in .m2, disabling the default remote repo:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<mirrors>
<mirror>
<id>my.mirror</id>
<name>My Mirror</name>
<url>https://repo.maven.apache.org/alwaysfail</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
Now I added this in my project pom.xml
<repositories>
<repository>
<id>myproject.repo</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
But it does not pick up my project specific remote repo and start downloading, what am I doing wrong?
It's important to note that values from an active profile in settings. xml will override any equivalent profile values in a pom. xml or profiles.
settings. xml contains system and/or user configuration, while the pom. xml contains project information. All build configuration ends up in the pom.
setting.xml
allows you to override definitions in pom.xml
, not the other way round. If you want to not use the overriding in settings.xml
in a particular build, you could prepare another settings file and call it explicitly:
$ mvn install -s /path/to/no-repo-override.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