title: How to use Bitbucket as a maven remote repository?
body: <p>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:</p>
  
  <p><a href="https://bitbucket.org/mycompany/maven-repository">https://bitbucket.org/mycompany/maven-repository</a></p>
  
  <p>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.</p>
  
  <p>Here is what I was trying so far to push one sample project into the remote repo:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                    http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
  &lt;artifactId&gt;corporate-pom&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;MyCompanyRepo&lt;/id&gt;
          &lt;url&gt;https://bitbucket.org/mycompany/maven-repository&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  &lt;build&gt;
      &lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.7&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>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.</p>
  
  <p>When  I run <strong>mvn deploy</strong> command, this is the error I get:</p>
  
  <pre><code>C:\Cooler\Work\dev\Projects\mycompany\wal-common&gt;mvn deploy
  [WARNING]
  [WARNING] Some problems were encountered while building the effective settings
  [WARNING] Unrecognised tag: 'snapshotPolicy' (position: START_TAG seen ...&lt;/layo
  ut&gt;\n          &lt;snapshotPolicy&gt;... @203:27)  @ C:\Users\cooler\.m2\settings.xml,
  line 203, column 27
  [WARNING]
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building corporate-pom 1.0
  [INFO] ------------------------------------------------------------------------
  [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:\
  Users\cooler\.m2\repository\com\mycompany\corporate-pom\1.0\corporat
  e-pom-1.0.pom
  [INFO]
  [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ corporate-pom ---
  Uploading: https://bitbucket.org/mycompany/maven-repository/com/mycompany/corporate-   pom/1.0/corporate-pom-1.0.pom
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [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 (https://bitbucket.org/mycompany/maven-repository): Connection to h
  ttp://:8080 refused: Connection refused: connect -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
  ch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please rea
  d the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
  xception 
  </code></pre>
  
  <p>Thanks for your help.</p>