How can I prevent Maven from loading maven-metadata.xml for an artifact I already have in my repo?
I'm using Maven 3.2. I have this dependency in my pom.xml file (WAR project)
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>1.6.2</version>
<scope>provided</scope>
</dependency>
Whenever I run any phase for my pom (like "mvn install") the application always tries to load some metadata about the dependency ...
Downloading: http://repo.spring.io/milestone/joda-time/joda-time/maven-metadata.xml
How do I tell Maven to stop doing this? I already have an artifact cached in my local Maven repository.
Thanks - Dave
+3
source to share
2 answers
Perhaps upgrade policies need to be specified explicitly. See this answer: Why does Maven load maven-metadata.xml every time?
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://gotoNexus</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
+7
source to share
This means that somewhere in your dependency tree, either SNAPSHOT or a version range (direct or transitive dependency) is used. For both cases, the solution is the same: lock the version to a specific version. Did you block it as a direct dependency or inside a dependencyManagement?
+3
source to share