Z
Z
zimyx2014-06-14 18:53:52
Maven
zimyx, 2014-06-14 18:53:52

How to use Maven repositories declared in dependency POM files in Gradle?

I use the mavenCentral() repository in the project and declare a dependency:
compile 'com.turn:ttorrent:1.4'
com.turn.ttorrent is just an example, so this is not about it, but about its POM file.
When trying to build the project, there is a problem with an unresolved dependency: net.sf.jargs. This artifact could not be found in the mavenCentral() repository. Further, I found out that in the description of ttorrent there is a declaration of an external repository:

<repositories>
        <repository>
            <id>jboss-thirdparty-releases</id>
            <name>JBoss Thirdparty Releases</name>
            <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/</url>
        </repository>
    </repositories>

Adding this repository manually to the project solves the problem. But if the maintainers of any dependency suddenly want to add more such repositories, then problems will begin. Why didn't Gradle itself use this repository? How can I make it look for repositories in the POM?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2014-06-14
@Gilga

repositories {
    maven {
        url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/"
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question