Vivek Dhiman
Vivek Dhiman

Reputation: 1995

Maven Repo Order

I want to prioritize the order of repo to download dependencies. Such that, firstly, I want all my dependency will download from default maven repo http://repo1.maven.org/maven2 then if required plugin didn't find, fall back on the other repo to find it say https://repo.adobe.com/nexus/content/groups/public/ . I am using maven2.2.1. I have tried by adding below code in my project's pom

<distributionManagement>
        <repository>
            <id>adobe-public-releases</id>
            <name>Adobe Public Repository</name>
            <url>http://repo.adobe.com/nexus/content/groups/public</url>
            <layout>default</layout>
        </repository>
</distributionManagement>

But still getting below error:

[DEBUG] Connecting to repository: 'central' with url: 'http://repo1.maven.org/maven2'.
Downloading: http://repo1.maven.org/maven2/org/apache/abdera/abdera-extensions-opensearch/1.0-R783018/abdera-extensions-opensearch-1.0-R783018.pom
[DEBUG] Unable to locate resource in repository
org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate resource in repository

My settings.xml file is same as default provided.

Thanks,

Upvotes: 0

Views: 75

Answers (1)

Martin Theiss
Martin Theiss

Reputation: 1010

/project/distributionManagement is where your own artifacts will be uploaded.

For dependency resolution, you must use /project/repositories

Upvotes: 1

Related Questions