Gradle doesn't seem to be downloading dependencies from the custom Maven repository defined in a POM of a dependency


(Lomesh Patel) #1

I’m using maven-publish to publish a jar to our custom Maven repository which has a dependency to another jar located at another custom Maven repository.

Here’s the maven-publish code to add repositories to the published pom:

publishing {
    publications {
        maven(MavenPublication) {
            from project.components.java

            pom.withXml {
                def confluentRepo = asNode().appendNode('repositories').appendNode('repository')
                confluentRepo.appendNode('id', 'confluent')
                confluentRepo.appendNode('name', 'Confluent')
                confluentRepo.appendNode('url', 'http://packages.confluent.io/maven/')
            }
        }
    }
}

Here’s the generated pom:

<project>
.
.
  <dependencies>
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-avro-serializer</artifactId>
      <version>2.0.1</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>confluent</id>
      <name>Confluent</name>
      <url>http://packages.confluent.io/maven/</url>
    </repository>
  </repositories>
</project>

But when I add this published module as a dependency to another project, gradle fails to download the jar that’s located at this custom repository.

I’m using gradle version 2.12

Any help is much appreciated.


(Eric Wendelin) #2

Mind if I ask which version of Gradle you’re using here?


(Lomesh Patel) #3

I knew I was missing something. Sorry about that.

I’m using version 2.12