I’m using Maven 3.2. I have this dependency in my pom.xml file (a 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 (e.g. “mvn install”), the app always attempts to download 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 that? I already have the artifact cached in my local Maven repo.
Thanks, - Dave
Maybe the update policies need to be specified explicitly. See this answer: Why is Maven downloading the 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>
This means that somewhere in your dependency tree either a SNAPSHOT or a version-range is used (direct or as transitive dependency). For both cases the solution is the same: lock the version to a specific release. Did you lock it as direct dependency or within dependencyManagement?
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