-
Bug
-
Resolution: Duplicate
-
Minor
-
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)