gpt4 book ai didi

java - 即使将 'updatePolicy' 设置为 'never' 后,Maven 也会下载metadata.xml

转载 作者:太空宇宙 更新时间:2023-11-04 13:54:08 25 4
gpt4 key购买 nike

我使用 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>

这是 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

我考虑过this问题以及this一。他们建议在 settings.xmlpom.xml 中将发布或快照的 UpdatePolicy 设置为 never,但这并没有解决我的问题。造成这种情况的可能原因有哪些?还有其他解决方案吗?

最佳答案

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

关于java - 即使将 'updatePolicy' 设置为 'never' 后,Maven 也会下载metadata.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30012126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com