Use readMavenPom
like this:
pom = readMavenPom file: 'pom.xml'
pom.version
See Model reference for properties (like the above version).
For this to work, one has to install Pipeline Utility Steps plugin
More Related Contents:
- Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject
- mvn release:prepare not committing changes to pom.xml
- Getting Project Version from Maven POM in Jenkins
- How to manage maven settings.xml on a shared jenkins server?
- Prevent Jenkins from Installing Artifact to Local Maven Repository
- Differences between dependencyManagement and dependencies in Maven
- Maven dependencies are failing with a 501 error
- Maven: Lifecycle vs. Phase vs. Plugin vs. Goal [closed]
- What is under in pom.xml for?
- Jersey fails when creating uber jar with maven-assembly-plugin
- Tomcat casting servlets to javax.servlet.Servlet instead of jakarta.servlet.http.HttpServlet
- Maven – exclude folder from build
- How can I trigger another job from a jenkins pipeline (jenkinsfile) with GitHub Org Plugin?
- failsafe plugin won’t run on one project but will run on another — why?
- Strange variable scoping behavior in Jenkinsfile
- Maven: excluding java files in compilation
- Maven compilation issue with Java 9
- wildfly 10: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
- Maven versioning best practices [closed]
- Getting “Skipping JaCoCo execution due to missing execution data file” upon executing JaCoCo
- How to resolve cyclic dependency in Maven?
- Cannot get maven project.version property in a Spring application with @Value
- What is the meaning of type “bundle” in a maven dependency?
- How to place the output jar into another folder with maven?
- By default, where does Spring Boot expect views to be stored?
- Create JSON strings from Groovy variables in Jenkins Pipeline
- Cannot define variable in pipeline stage
- Android Studio – Could not find intellij-core.jar
- Maven : error: generics are not supported in -source 1.3 , I am using 1.6
- Jenkins Pipeline Job with file parameter