Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31301

Deprecated method call used in nexus-staging-maven-plugin causes failures with newer guava.

    Details

    • Notability:
      3

      Description

      The nexus-staging-ant-tasks makes a deprecated call to com.google.common.base.Stopwatch().

      From the JavaDoc:

      /**
       * Creates (but does not start) a new stopwatch using {@link System#nanoTime}
       * as its time source.
       *
       * @deprecated Use {@link Stopwatch#createUnstarted()} instead. This
       *     constructor is scheduled to be removed in Guava release 17.0.
       */
      @Deprecated
      public Stopwatch() {
       this(Ticker.systemTicker());
      }
      

      So that should be changed to:

      Stopwatch watch =  Stopwatch.createUnstarted();
      

      Without this change, if a newer guava library is on the classpath you'll see this failure:

       

      [ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.11:deploy-staged-repository (default-cli) on project standalone-pom: Execution default-cli of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.11:deploy-staged-repository failed: An API incompatibility was encountered while executing org.sonatype.plugins:nexus-staging-maven-plugin:1.6.11:deploy-staged-repository: java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.<init>()V from class com.sonatype.nexus.staging.client.internal.StagingWorkflowV3ServiceImpl

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Gili Tzabari Gili Tzabari
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title