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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to fetch my build artificat[Jar] after maven build completed

I m building jar through maven and converting it to docker image. How can i fetch my jar to pass to docker file. In log, it is stating that it is available in .m2. How to pass to next step:

Installing /opt/atlassian/pipelines/agent/build/target/gs-spring-boot-docker-0.1.0.jar to /root/.m2/repository/org/springtest/gs-spring-boot-docker/0.1.0/gs-spring-boot-docker-0.1.0.jar
[INFO] Installing ./pom.xml to /root/.m2/repository/org/springtest/gs-spring-boot-docker/0.1.0/gs-spring-boot-docker-0.1.0.pom

2 answers

There are different ways. Your jar files will be in the target folder relative to the working directory. You can just fetch from there. Or you can it defined as a shared artifact and download it in another stage or a different build. It depends on how the build is designed and where the Dockerfile reside.

Thank you Jobin. Can you please let me know how to make it as shared artifact and use it for another stage of build.

My source is in below link:

https://bitbucket.org/testdocker/firstproject/src

I m trying to pass gs-spring-boot-docker-0.1.0.jar which was build by maven to my Dockerfile to create image. But i was not able to pass jar file.

Any help would be appreciated. 

I am sorry, I assumed that you were using Bamboo foir the build. I see now that you are using Bitbucket pipelines. Not sure about that one Hopefully someone has an idea on how that works.

No problem Jobin. Thank you for your response

@Jobin Kuruvilla _Adaptavist_ @ArchanaI am facing similar issue and I am using bamboo build pipeline. Is there any way we can use shared artifacts in the next stages if the version name changes after every maven build / release? I need to get the exact spring boot jar name (including version) to use it in the deployment project. 

In the case of Bitbucket pipelines. 
Once build,  Use the artifacts to load from the target for this example I am using mvn for build

 script:

      - mvn clean install

 artifacts:

      - /target/test-docker-0.1.0.jar

And then you can use it in other places:

FILE: 'target/test-docker-0.1.0.jar'

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

451 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you