0
votes

I am struggling with the upload of a SNAPSHOT artifact to Sonatype oss. I am able to upload the artifact: https://oss.sonatype.org/content/repositories/snapshots/com/github/st-h/vertx-mongo-streams/2.1.0-SNAPSHOT/

However, when I try to use that library as a dependency, it always tries to download a version which does not exist. for instance this is my latest build error:

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 :

The latest version available is *-8. However, Gradle tries to download *-9

this is the latest config of the 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>

However, I previously had tried using it with just autoReleaseAfterClose enabled, but that shows the same error.

1

1 Answers

0
votes

The timestamp in Nexus is off by one second. So I think problem is likely to be this Apache Maven bug:

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

with root cause of this:

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

If you're not running Apache Maven version 3.5.2 or higher try upgrading Maven.