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

Typing Return Value of readMavenPom Causes ClassCastException

XMLWordPrintable

      import org.apache.maven.model.Model
      
      Model mavenProject = readMavenPom(file: pom)
      

      The above groovy script causes a ClassCastException when executing a Pipeline script:

      [Pipeline] echo
      Marking build as failure due to the following error: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.foo:bar-api:jar:0.6.1-201612151515.0777507' with class 'org.apache.maven.model.Model' to class 'org.apache.maven.model.Model'
      [Pipeline] stage
      

            Unassigned Unassigned
            timeapen Tim Eapen
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: