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

NPE on "Selected Module Last Version" when Jenkins Job Name != artifactId

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-info-plugin
    • None

      Jan 21, 2014 4:55:55 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.getVersion(job) in /view/WIP/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:101)
              at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:113)
              at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
              at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
              at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
              at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
              at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
              at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
              at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
              at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
              at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      

      The exception seems to be caused by the fact that the Jenkins Job name is different from the actual POM's artifactId and it tries to use the former to get the version of the latter.

      Attached patch fixes the issue for me but I'm unsure if this is the correct way to go about it. It does seem to fix the issue for us though for both single and multi-module Maven projects.

      If this is the/a correct fix I can send a pull request if you prefer.

            emenaceb Emilio Jose Mena Cebrian
            marelooke Bert Geens
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: