1

This is my current working setup: setup

I want to automate these variables: automation

Is there a way to automate the version number in this build step? E.g. extract it from the root pom.xml?

I already tried putting ${project.version} inside the version field, but that didn't work either. Which placeholder am I required to use here, as the field is a required value and cannot be left empty?

Devxln
  • 556
  • 6
  • 18
  • Why not using Maven directly? via `mvn clean deploy`? – khmarbaise Jun 17 '19 at 20:28
  • @khmarbaise It's a public repository – Devxln Jun 17 '19 at 20:45
  • What does that mean: `It's a public repository`? You would like to publish into a repository which can simply being done via Maven? No need for supplemental configuration in Jenkins. – khmarbaise Jun 18 '19 at 07:25
  • @khmarbaise I would like to use nexus repository manager for managing my repos. If I had to use `mvn clean deploy` I would need my admin password for nexus inside my publicly hosted `pom.xml` on github, and I dont want that. – Devxln Jun 18 '19 at 12:19
  • You have to use the credentials in Jenkins via Credentials store...not in Git ... – khmarbaise Jun 18 '19 at 12:21
  • @khmarbaise Could you tell me how your solution would work? What things I should add to my pom.xml? I already have my credentials inside jenkins stored for nexus. – Devxln Jun 18 '19 at 14:07

1 Answers1

2

Write ${POM_VERSION} instead of 1.0.0

You can also use ${POM_GROUPID} and ${POM_ARTIFACTID} for the group and for the id of the project.

ferpinan
  • 161
  • 2
  • 14