Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 build a repository which is depending on another repository

Hi all,

I have very little experience in using bamboo and really hope to get some hints on the question I am facing.

I have one system which splits into two respositories in stash, let's say project A and B and B requires the jar/classes built from project A to complete it build process. In project B pom.xml, it states the dependency 

<dependency>
<groupId>com.project.A</groupId>
<artifactId>ProjectA</artifactId>
<version>1.0.0-SNAPSHOT</version>

.....

 

and when running maven on project A, we need to run "clean install" instead of "clean package" such that project B can access the project A binary. 

I found that it makes our build not easy to manage and I think there should be other way that Project A produces jar/classes binaryin one respostory and project B can get this binary into its build process. But I still cannot find out a way in bamboo how to achieve this purpose.

Can some of you share your experience in such build process scenario ? 

I look at some artices in web and still cannot get it work in bamboo.

Do I need to remove the dependency in project B and direct reference to the jar in build process ? 

If any of you can show me the way, I will be very appreciated your help.

Please kindly help

Thanks fo ryour kind attention,

Ray

 

 

1 answer

0 votes

Hi Ray, 

I'm not sure if I understood it correctly but, have you tried to make the jars produced by the Proj A available as artifacts and then download them during the Proj B build process?

Another thing that you could try is to create a local maven repository and add the jar files produced by Proj A there using a solution described in the following StackOverflow thread:

Does that make any sense to your use case?


Thank you.

best,
Gabriel Ribeiro

Hi Gabriel,

Really thanks for your reply, your understanding is correct, actually, I know how to share one project artifacts to another project, but within the same repository. I am not really sure if this principle can be applied to two separate repository artifact sharing in build process. 

I have also explored your suggestion to use a local maven repository, is it an approach that create a local (or temporary) repository with maven pom instructions, then one project "clean install" its package into the local/temporary repository and another project tries to reference the local/temporary repository installed artifacts in build process.

Really appreciate you can help me on this topic

 

Many thanks,

Ray

Hi Gabriel,

For sharing artifact from another repository, how the pom.xml be referening the artifact at runtime ?

Would you share me your idea ?

Many thanks,

Ray

Hi Rey,

I think this solution would be the best approach but, you can reference your jar file directly like this:

<dependency>
    <groupId>com.sample</groupId>
    <artifactId>sample</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/yourJar.jar</systemPath>
</dependency>

thanks

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
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