【问题标题】:Maven Versions Plug-in Skipping Update CheckMaven 版本插件跳过更新检查
【发布时间】:2012-06-26 22:17:45
【问题描述】:

当我尝试使用versions:use-releases 时,我的发布存储库被标记为“已禁用”,这意味着快照依赖项无法解析为发布。我不明白为什么认为存储库被禁用。

这是构建的简短调试输出:

[DEBUG]   (f) remoteArtifactRepositories = [       id: snapshots
      url: http://maven.live.hostname.net/content/repositories/snapshots/
   layout: default
snapshots: [enabled => true, update => daily]
 releases: [enabled => true, update => daily]
,        id: company-nexus
      url: http://maven.live.hostname.net/content/groups/public/
   layout: default
snapshots: [enabled => false, update => daily]
 releases: [enabled => true, update => daily]
]
[...]
[DEBUG] Looking for a release of promotion-test-central:promotion-test-central:jar:1.6.0-SNAPSHOT
[INFO] artifact promotion-test-central:promotion-test-central: checking for updates from snapshots
[DEBUG] Reading resolution-state from: /home/tester/.m2/repository/promotion-test-central/promotion-test-central/resolver-status.properties
[DEBUG] Writing resolution-state to: /home/tester/.m2/repository/promotion-test-central/promotion-test-central/resolver-status.properties
[DEBUG] Skipping update check for artifact promotion-test-central:promotion-test-central (/home/tester/.m2/repository/promotion-test-central/promotion-test-central/maven-metadata-company-nexus.xml) from disabled repository company-nexus (http://hostname/content/groups/public/)

我运行一个设置,将central 的请求镜像到我们的 Nexus 实例,并且还指定了一个全局快照存储库:

    <mirrors>
        <mirror>
            <id>mendeley-nexus</id>
            <mirrorOf>central</mirrorOf>
            <url>http://maven.live.chonp.net/content/groups/public/</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>default</id>
            <repositories>
                <repository>
                    <id>snapshots</id>
                    <url>http://maven.live.chonp.net/content/repositories/snapshots/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>default</activeProfile>
    </activeProfiles>

存在相关依赖项的发布版本和快照版本,并且存储库在所有其他方面都按预期工作。

【问题讨论】:

标签: maven maven-3 nexus


【解决方案1】:

您的 settings.xml 文件应配置为as documented in the Nexus book。你的配置不会起作用,因为它只是部分覆盖了 Maven 的超级 pom。

【讨论】:

  • 对不起,但这没有多大意义。当然,如果我在 nexus 配置文件上为快照和版本启用单个 repo,它将起作用。但我为什么要这样做?仅在快照存储库中查找版本有什么意义?
  • 关键是您将所有内容(发布和快照)镜像到公共组中,您需要使它们能够通过。除非你当然不想使用快照..
  • 理想情况下,我希望将我的快照保留在公共存储库之外,否则为什么还要费心拥有 2 个存储库?无论如何,这里的问题是相反的,在快照存储库中寻找版本。我的理解是,maven 家伙的意思是快照 repo 保留所有 plus 快照,而不仅仅是快照。如果只是更明确地记录,这对我来说也很好。
  • 谢谢.. 我对同样的问题感到震惊,并且永远不会得到这个解决方案。只是想知道,如果 Maven 家伙不是要快照 repo 来保留所有内容以及快照,那为什么??
【解决方案2】:

我也遇到过这个。我能够通过这样做来克服它:

    <repository>
        <id>my-snapshots</id>
        <url>https://nexus.corp.company.com/nexus/content/repositories/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>

这与以前的不同:

        <releases>
            <enabled>false</enabled>
        </releases>

当 Maven 查找您的 当前 工件的元数据并将其搜索限制为仅可能包含该工件的存储库时,似乎会发生这种情况。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-02
    • 2016-09-09
    • 2018-09-02
    • 1970-01-01
    • 2021-06-25
    • 2014-08-04
    • 1970-01-01
    相关资源
    最近更新 更多