简体   繁体   中英

Maven downloads metadata.xml even after setting 'updatePolicy' to 'never'

I use Maven to handle the dependencies and also Nexus as a repository manager. In my new project, I have several dependencies for which Maven downloads metadata.xml files every day. Since they are released versions , I just don`t want maven to spend some time downloading these files.

Here are the dependencies in pom.xml

    <dependencies>
    <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>file-management</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-shared-io</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>3.0.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.2</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.0.8</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>2.0.6</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.emf</groupId>
        <artifactId>org.eclipse.emf.common</artifactId>
        <version>2.8.0-v20120911-0500</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.emf</groupId>
        <artifactId>org.eclipse.emf.ecore.xmi</artifactId>
        <version>2.8.0-v20120911-0500</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.emf</groupId>
        <artifactId>org.eclipse.emf.ecore</artifactId>
        <version>2.8.0-v20120911-0500</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.emf</groupId>
        <artifactId>org.eclipse.emf.mapping.ecore2xml</artifactId>
        <version>2.5.0.v20100521-1847</version>
    </dependency>

    <dependency>
        <groupId>org.eclipse.uml2</groupId>
        <artifactId>org.eclipse.uml2.uml</artifactId>
        <version>3.1.0.v201006071150</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.uml2</groupId>
        <artifactId>org.eclipse.uml2.uml.resources</artifactId>
        <version>3.1.0.v201005031530</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.uml2</groupId>
        <artifactId>org.eclipse.uml2.common</artifactId>
        <version>1.5.0.v201005031530</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.5.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.twdata.maven</groupId>
        <artifactId>mojo-executor</artifactId>
        <version>2.1.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-profile</artifactId>
        <version>2.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-invoker</artifactId>
        <version>2.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-project</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-descriptor</artifactId>
        <version>2.1.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.8.3</version>
    </dependency>
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils-core</artifactId>
        <version>1.8.3</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <!-- start xpand dependencies -->
        <groupId>com.ibm.icu</groupId>
        <artifactId>icu4j</artifactId>
        <version>4.8.1.1</version>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>org.mod4j.org.eclipse</groupId>
        <artifactId>xpand</artifactId>
        <version>0.7.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.mod4j.org.eclipse.emf</groupId>
                <artifactId>ecore</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.mod4j.org.eclipse</groupId>
                <artifactId>text</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.mod4j.org.apache.commons</groupId>
                <artifactId>logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.mod4j.org.eclipse.xtend.typesystem</groupId>
        <artifactId>emf</artifactId>
        <version>0.7.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.mod4j.org.eclipse.emf</groupId>
                <artifactId>ecore</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.mod4j.org.eclipse.emf.mwe</groupId>
        <artifactId>utils</artifactId>
        <version>0.7.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.mod4j.org.eclipse.emf</groupId>
                <artifactId>ecore</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.mod4j.org.eclipse.jface</groupId>
        <artifactId>text</artifactId>
        <version>3.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.mod4j.org.eclipse.xtend.util</groupId>
        <artifactId>stdlib</artifactId>
        <version>0.7.2</version>
    </dependency>

    <!-- end xpand dependencies -->
    <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6.1</version>
        <exclusions>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

And here is the build output from maven:

Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/xtend/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/xtend/maven-metadata.xml (362 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/emf/mwe/core/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/emf/mwe/core/maven-metadata.xml (369 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/runtime/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/runtime/maven-metadata.xml (338 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/osgi/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/osgi/maven-metadata.xml (330 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/common/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/common/maven-metadata.xml (340 B at 0.0 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/jobs/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/jobs/maven-metadata.xml (341 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/registry/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/registry/maven-metadata.xml (348 B at 0.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/preferences/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/preferences/maven-metadata.xml (351 B at 0.2 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/contenttype/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/contenttype/maven-metadata.xml (342 B at 1.2 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/app/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/equinox/app/maven-metadata.xml (337 B at 1.0 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/apache/commons/cli/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/apache/commons/cli/maven-metadata.xml (336 B at 1.2 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/apache/commons/lang/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/apache/commons/lang/maven-metadata.xml (337 B at 1.2 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/antlr/runtime/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/antlr/runtime/maven-metadata.xml (331 B at 1.2 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/emf/common/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/emf/common/maven-metadata.xml (336 B at 1.1 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/jdt/core/maven-metadata.xml
Downloaded: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/jdt/core/maven-metadata.xml (334 B at 0.0 KB/sec)
Downloading: https://nexus.foo.com/content/groups/internal/org/mod4j/org/eclipse/core/resources/maven-metadata.xml

I considered this question and also this one. They suggest setting UpdatePolicy to never for releases or snapshots in settings.xml or pom.xml , but it did not solve my problem. What are the possible reasons for this? Any other solution?

If you have updated ~/.m2/settings.xml and the metadata is still downloading each time, check the $MAVEN_HOME/conf/settings.xml file. (you can quickly determine $MAVEN_HOME by the results of "mvn -v")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM