[HAP-909] NPE on gather build info Created: 12/Apr/17 Updated: 25/Jun/17 Resolved: 25/Jun/17
|Project:||Jenkins Artifactory Plug-in|
|Affects Version/s:||2.9.1, 2.10.3|
|Reporter:||Nikolas Falco||Assignee:||Eyal Ben Moshe|
We are using jenkins 2.32.3 with installed:
With a jenkins job of kind Free Style and a build step of kind "Invoke Artifactory Maven" and the same with a Maven Job during deploy of artifacts it fails with a NPE.
|Comment by Nikolas Falco [ 13/Apr/17 ]|
In the past we fall in this NPE randomly but now it happens every build also changing the artifactory plugin version and kind of job (free style/maven style). This block deploy on our organization (licensed) artifactory.
After a long session of debug the issue happens on our "distribution" module (package of kind "pom") placed in a profile (virgo WAS profile). Inside that module we use the maven-assembly-plugin (3.0.0) to generate a zip archive to gather all dependencies.
Follow the `toString()` of the maven project dependencies:
As you can see some dependencies, for some reason, has scope set to empty string. Their scope is the default.
The fix in BuildInfoRecorder is easy, in the method `mergeProjectDependencies(Set<Artifact>)` like you do for classifier where you check is if it null and set to empty string, the same you should for scope, set to default if is empty string.
|Comment by Eyal Ben Moshe [ 13/Apr/17 ]|
Thanks for contributing the fix Nikolas!