Java Maven甚至在设置';更新策略';至';绝不';

Java Maven甚至在设置';更新策略';至';绝不';,java,maven,dependencies,pom.xml,maven-metadata,Java,Maven,Dependencies,Pom.xml,Maven Metadata,我使用Maven来处理依赖关系,还使用Nexus作为存储库管理器。在我的新项目中,我有几个依赖项,Maven每天下载metadata.xml文件。由于它们是发布版,我不想让maven花时间下载这些文件 以下是pom.xml <dependencies> <dependency> <groupId>org.apache.maven.shared</groupId> <artifactId>f

我使用Maven来处理依赖关系,还使用Nexus作为存储库管理器。在我的新项目中,我有几个依赖项,Maven每天下载
metadata.xml
文件。由于它们是发布版,我不想让maven花时间下载这些文件

以下是
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>

我考虑了一个问题,也是一个问题。他们建议在
settings.xml
pom.xml
中为发布或快照设置
UpdatePolicy
never
,但这并没有解决我的问题。可能的原因是什么?还有其他解决方案吗?

如果您更新了~/.m2/settings.xml,并且每次都在下载元数据,请查看$MAVEN_HOME/conf/settings.xml文件。(您可以通过“mvn-v”的结果快速确定$MAVEN_HOME)

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