Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64333

NullPointerException: GERRIT_NAME not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • sonar-gerrit-plugin
    • None

      I use currently a multibranch pipeline and want to integrate the sonar finding in our gerrit process. As far as I know it is not recommended to use the plugin without the gerrit-trigger-plugin but it should work regarding the documentation. 

      In case when the plugin is runing outside of a job with Gerrit Trigger the next environmental variables should be set:
      
      GERRIT_NAME - Gerrit server name
      GERRIT_CHANGE_NUMBER - Change number
      GERRIT_PATCHSET_NUMBER - Patchset number

      However, I tried to set the GERRIT_NAME as environment variable with the environment{} block and with the withEnv{} wrapper and always get a NPE.

      java.lang.NullPointerException
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
      	at com.google.common.base.MoreObjects.firstNonNull(MoreObjects.java:52)
      	at org.jenkinsci.plugins.sonargerrit.review.GerritConnectionInfo.retrieveServerName(GerritConnectionInfo.java:76)

       

            aquarellian Tatiana Didik
            incrediblelou Christian Louis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: