How to use Bitbucket as a maven remote repository?

We are planning to use bitbucket as source code repository as well remote repository for our maven based projects. I have created a repository on bitbucket something like below:

  • Jenkins returned status code 128
  • Deploy web project under GIT version control to shared hosting
  • Why git pull fails?
  • Git error: src refspec master does not match any error: failed to push some refs
  • How do I bring my current branch up to date while maintaining added work?
  • Git: Efficient steps to create a new branch and push to remote
  • How can I push my company specific project jars into the above remote repository using the project specific pom.xml? Can you help me with a sample pom.xml? We would be pushing all company specific jars into the above remote repository to be used by other projects within the company as maven dependencies.

    Here is what I was trying so far to push one sample project into the remote repo:

    <project xmlns=""

    The above is a parent pom, which will be included by all the other projects within the company and I wanted to push this to the remote repo to be used by other company specific projects.

    When I run mvn deploy command, this is the error I get:

    C:\Cooler\Work\dev\Projects\mycompany\wal-common>mvn deploy
    [WARNING] Some problems were encountered while building the effective settings
    [WARNING] Unrecognised tag: 'snapshotPolicy' (position: START_TAG seen ...</layo
    ut>\n          <snapshotPolicy>... @203:27)  @ C:\Users\cooler\.m2\settings.xml,
    line 203, column 27
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building corporate-pom 1.0
    [INFO] ------------------------------------------------------------------------
    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ corporate-pom
    [INFO] Installing C:\Cooler\Work\dev\Projects\mycompany\wal-common\pom.xml to C:\
    [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ corporate-pom ---
    Uploading:   pom/1.0/corporate-pom-1.0.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.607s
    [INFO] Finished at: Tue Sep 17 14:33:01 MST 2013
    [INFO] Final Memory: 7M/122M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
    deploy (default-deploy) on project corporate-pom: Failed to deploy artifacts: Co
    uld not transfer artifact com.mycompany:corporate-pom:pom:1.0 from/
    to CompanyREPO ( Connection to h
    ttp://:8080 refused: Connection refused: connect -> [Help 1]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] For more information about the errors and possible solutions, please rea
    d the following articles:
    [ERROR] [Help 1]

    Thanks for your help.

  • how to use git to make commits from two different machines
  • Difference between git branch --set-upstream-to vs git remote add origin
  • Git accountability
  • Kernel source: Submitting patch
  • Need to get all file differences (added, modified, renamed) between two Git comits
  • Have git issue warnings
  • 4 Solutions collect form web for “How to use Bitbucket as a maven remote repository?”

    You can try it has instructions for bitbucket.

    An alternative to using bitbucket is to use a dropbox folder for company. Contains a very good step by step guide on how to do this.

    Install jars in a local maven repository.

    Make a directory e.g. maven-repo/repository

    cd into maven-repo

    execute the following (replacing the arguments by the ones that are relevant to your jar):

    mvn install:install-file -DgroupId=com.rapid_i -DartifactId=rapidminer -Dversion=5.3.006 -Dfile=/path/to/artifact/rapidminer.jar -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=./repository  -DcreateChecksum=true

    Share the folder to a BitBucket public repository.

    Create a repository in your pom.xml pointing to you bitbucket folder.(you must use /raw/master in the path !!)

    <project xmlns=""
    <!-- Dependency to jar on Maven Repository on Git-BitBucket -->
    <!-- Maven Repository on Git-BitBucket -->

    Source: Hosting Maven Repository for third-party jars on Git (Bitbucket/Github)

    How can I push my company specific project jars into the above remote
    repository using the project specific pom.xml?

    You can’t. shouldn’t in my opinion.

    Bitbucket is not intended to be a maven repository. Trying to get maven to deploy artifacts to BitBucket to it is just wrong may contravene Atlassian’s terms of use. On the other hand it might be fine.

    You either need to should instead deploy to your own local repository or a public one.

    I’ve now managed to get this working. I followed these instructions and I can deploy artifacts to bitbucket and then use those in another maven project.

    The tweaks I had to make to get it working were:

    1. Upgrade Wagon-Git to v0.2.0
    2. Configure Git using git config –global as it didn’t seem to be picking up the –local setting I had used previously

    I also manually added a to the repo but I don’t think this was actually required.

    Once you have successfully deployed to the repo you should see all your files in the usual way via the BitBucket web front end.

    Git Baby is a git and github fan, let's start git clone.