簡體   English   中英

即使將“ updatePolicy”設置為“從不”,Maven也會下載meta.xml

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

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

我認為這個問題也是這樣的。 他們建議將settings.xmlpom.xml發行版或快照的UpdatePolicy設置為never ,但它不能解決我的問題。 可能的原因是什么? 還有其他解決方案嗎?

如果已更新〜/ .m2 / settings.xml且每次仍在下載元數據,請檢查$ MAVEN_HOME / conf / settings.xml文件。 (您可以通過“ mvn -v”的結果快速確定$ MAVEN_HOME)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM