Home > Software engineering >  Stuck download of artifacts from private maven repository in BitBucket pipeline
Stuck download of artifacts from private maven repository in BitBucket pipeline

Time:10-04

In BitBucket Pipeline, I am using mvn clean compile command to build the project.

The project has pom.xml where it used some private bitbucket maven repository.

<repositories>
   <repository>
        <id>private-maven-repository</id>
        <name>Private Maven Repository</name>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <url>https://api.bitbucket.org/2.0/repositories/sdas/maven_repository/src/releases</url>
    </repository>
</repositories>

In pipeline, the most of the Central artifacts are getting downloaded and also able to connect the private maven repository, but still it stuck after some time to download some artifacts from private maven repository.

It is not about a specific artifact of private maven repository. Can someone help me to identify the problem or how to debug this issue in BitBukcket pipeline.

Note: When I run mvn clean compile in my local git bash, build was successful.

CodePudding user response:

I managed to fix this problem after overriding the repository with central maven repository. By means, forcing to download the artifacts first from maven central repository and then from private maven repository.

    <repository>
        <id>central</id>
        <name>Default Repository</name>
        <layout>default</layout>
        <url>https://repo1.maven.org/maven2</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
  • Related