2

I am trying to write a BitBucket pull request listener. But the jars related to it is not getting downloaded when I try to create a maven project.

<!-- https://mvnrepository.com/artifact/com.atlassian.bitbucket.server    /bitbucket-api -->

<dependency>
  <groupId>com.atlassian.bitbucket.server</groupId>
  <artifactId>bitbucket-api</artifactId>
  <version>4.0.0-m7</version>
  <scope>provided</scope>
</dependency>

[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.atlassian.bitbucket.server:bitbucket-api:jar:4.0.0-m7 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.470 s
[INFO] Finished at: 2017-09-05T13:31:54+05:30
[INFO] Final Memory: 6M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project bitbucketsniffer: Could not resolve dependencies for project com.bitbucketsniffer:bitbucketsniffer:jar:1.0-SNAPSHOT: Failure to find com.atlassian.bitbucket.server:bitbucket-api:jar:4.0.0-m7 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Is there a way to manually install the jars as we do with oracle dependency jar, if yes then will this work if I try to create an executable jar of this project?

2 Answers2

1

You need to define the repository as well.

So put this into your pom.xml file before <dependencies>:

<repositories>
    <repository>
        <id>atlassian</id>
        <url>https://maven.atlassian.com/content/repositories/atlassian-public/</url>
    </repository>
</repositories>

mvnrepository.com is just a search engine for various libraries. It usually gives you a link in a note when you need to include a repository.

Example:mvnrepository.com different repository example

Lyze
  • 385
  • 1
  • 4
  • 11
  • 1
    There are some compile dependencies for this, but when I checked the /repositories it shows analytics-api version as 3.69.2. But the required one is 4.0.0, how do I get this version if 'analytics-api' even the maven repository does not have that. – RahulSingh123321 Sep 05 '17 at 10:33
  • This solution worked for me, but I had to use `https://packages.atlassian.com/mvn/maven-atlassian-external/` instead (even though mvnrepository still showed the original url mentioned in this answer) – neXus Nov 09 '22 at 13:51
0

I spent more than a day to fix this and this worked for me.

There was following errors while creating new bitbucket plugin project through command: atlas-create-bitbucket-plugin-module

ERROR: Unable to resolve following dependencies in maven POP.xml:

com.atlassian.bitbucket.server > bitbucket-api

com.atlassian.bitbucket.server > bitbucket-spi

SOLUTION:

Added this segment to POM.xml

<repositories>
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>central</id>
        <name>bintray</name>
        <url>https://jcenter.bintray.com</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>central</id>
        <name>bintray-plugins</name>
        <url>https://jcenter.bintray.com</url>
    </pluginRepository>
</pluginRepositories>
Rakesh Bhalani
  • 668
  • 4
  • 10