Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.1
-
None
-
None
Description
Steps to reproduce the problem:
- Use the following settings.xml (replacing the URLs with valid URLs in your environment):
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <mirrors> <mirror> <id>mirror1</id> <url>http://nexus:8081/nexus/content/repositories/releases/</url> <mirrorOf> external:*, !snapshots.repo </mirrorOf> </mirror> </mirrors> <profiles> <profile> <id>use-snapshots-repo</id> <pluginRepositories> <pluginRepository> <id>snapshots.repo</id> <url>http://nexus:8081/nexus/content/repositories/snapshots/</url> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>snapshots.repo</id> <url>http://nexus:8081/nexus/content/repositories/snapshots/</url> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>use-snapshots-repo</activeProfile> </activeProfiles> </settings>
- Set up a project which uses an artifact from snapshots.repo which is not available in the local Maven repository
- Build the project: The build fails because Maven only tries to download from the releases repository.
Expected behaviour: Maven should have used the snapshots repo.
The root cause of the problem is that whitespaces around the separators in the mirrorOf configuration are not trimmed. When changing the configuration to
<mirrorOf> external:*,!snapshots.repo </mirrorOf>
the snapshots repository is used and the build passes.