Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract project version number from pom inside a bitbucket-pipeline file?

Kiran Korey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 22, 2018

I want to extract project version number from my pom.xml and pass it to the curl command in my bitbucket pipeline file.

For example :

Extract version number from the following lines 

<project>
<version>1.1.7</version>
<packaging>pom</packaging>
</project>

and pass it to curl command 

- curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"xyz-version.jar"

 

and the curl command is in bitbucket-pipelines.yml file

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events