-
Bug
-
Resolution: Duplicate
-
Minor
-
Jenkins 2.36, Pipeline 2.4, Pipeline Utility Steps 1.2.1
Oracle Java 1.8.0_40
Creation of a pom file from a pipeline
node ('master') { Model pom = new Model() pom.artifactId = 'my-test-project' pom.groupId = 'com.example.jenkins.test' pom.version = '1.1-SNAPSHOT' writeMavenPom(pom) }
using writeMavenPom fails with:
[Pipeline] End of Pipeline java.lang.ClassCastException: org.jenkinsci.plugins.pipeline.utility.steps.maven.WriteMavenPomStep.model expects class org.apache.maven.model.Model but received class org.apache.maven.model.Model
However, reading and existing pom, making modifications and writing those to a file works like a charm.
Test case for writeMavenPom (https://github.com/jenkinsci/pipeline-utility-steps-plugin/blob/master/src/test/java/org/jenkinsci/plugins/pipeline/utility/steps/maven/WriteMavenPomStepTest.java) passes, but it is using an older version of pipeline dependencies.
- duplicates
-
JENKINS-40514 Typing Return Value of readMavenPom Causes ClassCastException
- Open