【问题标题】:Sonatype nexus publish snapshot, but unable to downloadSonatype nexus 发布快照,但无法下载
【发布时间】:2018-12-21 16:00:42
【问题描述】:

我正在努力将 SNAPSHOT 工件上传到 Sonatype oss。我可以上传工件:https://oss.sonatype.org/content/repositories/snapshots/com/github/st-h/vertx-mongo-streams/2.1.0-SNAPSHOT/

但是,当我尝试将该库用作依赖项时,它总是会尝试下载不存在的版本。例如这是我最新的构建错误:

Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not find com.github.st-h:vertx-mongo-streams:2.1.0-SNAPSHOT.
     Searched in the following locations:
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/st-h/vertx-mongo-streams/2.1.0-SNAPSHOT/vertx-mongo-streams-2.1.0-20181221.154759-9.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/st-h/vertx-mongo-streams/2.1.0-SNAPSHOT/vertx-mongo-streams-2.1.0-20181221.154759-9.jar
     Required by:
         project :

可用的最新版本是 *-8。但是,Gradle 会尝试下载 *-9

这是 nexus-stagign-maven-plugin 的最新配置

<plugin>
  <groupId>org.sonatype.plugins</groupId>
  <artifactId>nexus-staging-maven-plugin</artifactId>
  <version>1.6.3</version>
  <extensions>true</extensions>
  <executions>
      <execution>
          <id>sign-artifacts</id>
          <phase>deploy</phase>
          <goals>
              <goal>deploy</goal>
          </goals>
      </execution>
  </executions>
  <configuration>
      <serverId>ossrh</serverId>
      <nexusUrl>https://oss.sonatype.org/</nexusUrl>
      <autoReleaseAfterClose>false</autoReleaseAfterClose>
      <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
      <autoDropAfterRelease>false</autoDropAfterRelease>
  </configuration>
</plugin>

但是,我之前曾尝试在仅启用 autoReleaseAfterClose 的情况下使用它,但显示相同的错误。

【问题讨论】:

    标签: maven gradle nexus


    【解决方案1】:

    Nexus 中的时间戳关闭一秒。所以我认为问题很可能是这个 Apache Maven 错误:

    https://issues.apache.org/jira/browse/MNG-6240

    根本原因:

    https://issues.apache.org/jira/browse/MDEPLOY-221

    如果您运行的不是 Apache Maven 3.5.2 或更高版本,请尝试升级 Maven。

    【讨论】:

    • 谢谢。我使用的是 maven 3.6.0(应该提到)。但是,我只是尝试使用我仍然安装在另一台机器上的旧版本(3.3.9),它显示了相同的结果。至少我可以确定过去从那台机器上部署的版本很好。但是,现在使用该库的项目尝试拉取版本 *-11,而上传的版本是 *-10。我总是看到 2 的增量...
    猜你喜欢
    • 1970-01-01
    • 2016-08-03
    • 2018-06-26
    • 1970-01-01
    • 2014-07-05
    • 2020-10-19
    • 2017-03-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多