0

I wanted to add my current pom/project version in my bitbucket pipeline commit.

I've used the command:

git commit -m "[skip ci] New POM version - ${project.version}"

but it gives me the error "Bad substitution".

Is there a way to add the current pom/project version to the commit message?

GG89
  • 11
  • 2
  • I've tried retrieving with the command mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version but without success. I get the error Unknown lifecycle phase ".version" – GG89 Dec 10 '21 at 11:53
  • What about quoting `project.version` like that? `mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression='project.version'` Aside fron that, you might want to add `-q -DforceStdout` to the command. – dan1st Dec 10 '21 at 12:33
  • Thank you. I managed to print the commit message but it's not only the project version. It's the entire build log. I've used `mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -D expression=project.version`. Also, with forceStdout it prints nothing – GG89 Dec 10 '21 at 13:40
  • I told you to add `-q`. This removes the typical verbose build log. – dan1st Dec 10 '21 at 14:20
  • With `-q` it doesn't print anything – GG89 Dec 10 '21 at 16:08
  • You should not put a space between `-D` and `expression`. – dan1st Dec 10 '21 at 16:37

0 Answers0