IntelliJ IDEA 13 doesn't recognize Maven mirrors
intellij-idea, maven
Solution
Using `mirrorOf` is discouraged, since it defeats the idea of having separate repositories for promotions (e.g. from snapshots to staging to releases), access control etc. This feature exists in Maven since the time there was no proper Binary Repository with multiple repositories support in the market, so Maven developers lived in the world where one proxy exposed one URL for all the remote repositories it proxied. That's, of course, no longer true. Another usage of this setting was to ensure your in-house repository is not shortcut by repositories declarations in dependencies' pom files, but there are better solutions for this problem as well.
All in all, don't use `mirrorOf`. Instead, you should "shadow" the `central` and `plugins` repositories, replacing them with your in-house repository URL.
Here's an example of `settings.xml` for Artifactory (should be similar for Nexus):
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-releases</name>
<url>http://jbaruch.artifactoryonline.com/jbaruch/libs-releases</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>remote-snapshot-repos</name>
<url>http://jbaruch.artifactoryonline.com/jbaruch/remote-snapshot-repos</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-releases</name>
<url>http://jbaruch.artifactoryonline.com/jbaruch/plugins-releases</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshots</name>
<url>http://jbaruch.artifactoryonline.com/jbaruch/plugins-snapshots</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
Problem
I have a Maven project with a mirror set up for `central` repo, like that: ``` <settings> ... <mirrors> <mirror> <id>central-my</id> <mirrorOf>central</mirrorOf> <name>Maven Central Repo mirror</name> <url>http://local_url:15999/nexus/content/repositories/central/</url> </mirror> </mirrors> ... </settings> ``` For some reason, when I import this project into IDEA and make it use this `settings.xml` it still doesn't see this mirror, showing me `http://repo.maven.apache.org/maven2` instead (`Project Settings` > `Maven` > `Repositories`). The problem is, I can't update from this repo because I'm on internal network. What can I do in this case?