Reputation: 16515
In my settings.xml
I declared a custom repository in a profile like this:
<servers>
<server>
<id>server.id</id>
<username><uname></username>
<password><pw></password>
</server>
</servers>
<profiles>
<profile>
<id>dev.id</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>repo.id</id>
<url>valid working url</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
what works great for all dependencies located there, but build fails whenever I declare dependencies which are located in the central repository. For instance:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
results in:
[ERROR] Failed to execute goal on project <name>: Could not resolve dependencies for project…
…Failed to read artifact descriptor for junit:junit-dep:jar:4.9.1-SNAPSHOT: Could not transfer artifact junit:junit-dep:pom:4.9.1-SNAPSHOT from/to <server.id>…
How can I make maven load dependencies correctly?
Upvotes: 0
Views: 1680
Reputation: 97467
You are trying to use a -SNAPSHOT dependency which is not available in Maven Central.
junit:junit-dep:jar:4.9.1-SNAPSHOT: Could not transfer artifact junit:junit-dep:pom:4.9.1-SNAPSHOT fr
In Maven central there are only releases available.
Furthermore the above dependency is not coming into your build by the junit:junit:4.11:jar dependency it must be comming from other sources.
Upvotes: 1