Sonatype nexus发布快照,但无法下载

时间:2018-12-21 16:00:42

标签: maven gradle nexus

我正在努力将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的情况下使用它,但这显示了相同的错误。

1 个答案:

答案 0 :(得分:0)

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。