mavenartifactsmaven-metadata

How do I prevent Maven from downloading maven-metadata.xml for an artifact that I already have in my repo?


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


Solution

  • 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>
    </pluginRepositories>