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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


How to run jar files from another bitbucket repo in main bitbucket pipelines?


I am working from my company's bitbucket account so I am trying to download the repo on which the required jar files are stored (I want to do this via ssh keys). I am working on creating the yaml file for bitbucket pipelines (for the main project repo) and I could not find a way to incorporate these jar files into my main repo as well as install dependencies - java 1.8 and sbt 1.6.2. I've seen a way to download the repo using a shell script and use maven... but is that necessary as there is no maven needed for this project? Please let me know which approach is best supported by Bitbucket to download jar files from external repos into bitbucket pipelines.

1 answer

0 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 20, 2022

Hey Hareem,

Welcome to the Bitbucket Cloud Community! :)

I believe the easiest and best way to execute files from another repository using SSH is to clone the external repository in pipelines and then execute the files once it has been cloned. 

To do this, you will need to follow these steps to give the main repository read access to the target repository:

  1. You will need to generate an SSH key from the main repository (The repository executing pipelines)
  2. Under Settings > Pipelines > SSH keys
  3. Once you have generated the key, copy it
  4. Click 'Copy public key'
  5. Add the key to the repository you're looking to clone
  6. In the target repository: Settings > General > Access keys paste the key here
  7. Add a clone command to the bitbucket-pipelines.yml on the main repository
       - git clone
  8. Once the repo has been cloned in pipelines, you can cd to the directory and then run files from here:
    - cd ./reposlug
    - java -jar script.jar

There is an article here that explains this in-depth with screenshots: 

Hope this helps.


- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events