首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven在将“metadata.xml”设置为“updatePolicy”为“从不”之后也会下载

Maven在将“metadata.xml”设置为“updatePolicy”为“从不”之后也会下载
EN

Stack Overflow用户
提问于 2015-05-03 09:15:00
回答 1查看 1.2K关注 0票数 2

我使用Maven处理依赖项,并使用Nexus作为存储库管理器。在我的新项目中,我有几个依赖项,Maven每天都会下载metadata.xml文件。因为它们是发布的版本,所以我不想让maven花一些时间下载这些文件。

下面是pom.xml中的依赖项

代码语言:javascript
运行
复制
    <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>

下面是来自maven的构建输出:

代码语言:javascript
运行
复制
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

我考虑了this问题,也考虑了this问题。他们建议将UpdatePolicy设置为never,以便在settings.xmlpom.xml中发布或快照,但这并没有解决我的问题。可能的原因是什么?还有其他解决办法吗?

EN

回答 1

Stack Overflow用户

发布于 2015-10-21 20:46:26

如果您已经更新了~/.m2/setings.xml,并且每次仍在下载元数据,请检查$MAVEN_HOME/conf/setings.xml文件。(您可以根据"mvn $MAVEN_HOME“的结果快速确定$MAVEN_HOME)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30012126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档