Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to share artifacts between pipelines?

fredand44 October 5, 2018

Hello!

I'm a bit new to Bitbucket and pipelines.

Is there a way to use a artifact from one pipeline in an other pipline?

Suppose you got separate repos and pipelines for these repos:

  • my-common
  • my-app

If my-app got a dependency to my-common how do I solve that?

Is there a way to install the my-common in some maven repo that is accessible from the pipeline that build's my-app?

Best regards

Fredrik

1 answer

0 votes
fredand44 October 9, 2018

Hello!

I think solved it, but any comments for improvements are welcome.

1) I created a private maven-repo for eg at mymavenrepo.com

2) I followed the tutorial at: https://confluence.atlassian.com/bitbucket/java-with-bitbucket-pipelines-872013773.html
I choosed to go for using a settings.xml of my own instead of using sed.

3) I deployed it in my pipeline like:

- mvn -s ../settings.xml clean install deploy:deploy-file -DgroupId=mygroup -DartifactId=myartifact -Dversion=1.2.3 -Dpackaging=jar -Dfile=path/to/my.jar -DrepositoryId=my-private-repo -Durl=https://mymavenrepo.com/repo/qwertyuiopa/

4) Now in my other projects where I have dependency to this artifact I add the dependecy in my pom.xml and in my local settings.xml I added the server and the repo like they did in the tutorial in step 2 above.

Best regards

Fredrik

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events