Library Dependencies not being resolved

My team uses a set of extension functions for JSON-Java that originated in one project, and has now been copy/pasted in to various new projects.

For the sake of maintainability I’m trying to clean this up by consolidating all these extensions in a Kotlin library that can be consumed as a dependency by the different projects.

We use Jenkins to build the library JAR, and the Artifactory Jenkins plugin to publish it to our company’s Artifactory instance. These steps are working as expected.

The bummer is that consumers of the dependency still have declare implementation org.json:json:<version> in their build file themselves. I know Gradle is smart enough to resolve transitive dependencies, so I have to assume I’m doing something wrong in the build/publish process.

I decided to start by trying Gradle Module Metadata rather than a POM file since I’m not doing anything Maven-centric.

Here’s what that file looked like:

  "formatVersion": "1.1",
  "component": {
    "group": "com.example.extensions",
    "module": "ext-org-json",
    "version": "0.0.1"
  "createdBy": {
    "author": "",
    "gradle": {
      "version": "6.7"
  "variants": [
      "name": "api",
      "attributes": {
        "org.gradle.usage": "java-api",
        "org.gradle.category": "library",
        "org.gradle.libraryelements": "jar"
      "dependencies": [
          "group": "org.json",
          "module": "json",
          "version": "20201115",
          "reason": "This module exists to extend its API."
          "group": "org.jetbrains.kotlin",
          "module": "kotlin-stdlib",
          "version": "1.4.21"

Unfortunately, the module metadata didn’t seem to do it, so I then tried this POM file, which didn’t seem to work either:



    <name>JSON in Java Extensions</name>
        Useful extension API for JSON in Java.
            <name>License Name</name>
               Legalese words that mean things.

            <name>Ryan Smith</name>




This is my first time doing something like this, so any direction is deeply appreciated!

I am not sure how you are publishing your library but as of Gradle 6 it should be creating the .pom and .module files for you:

I noticed in your .module file you have incorrectly defined your version which requires it be an object like this:

"version": { "requires": "20201115" }

However from a quick look it seems your .pom file should have worked.

Make sure in the project you are testing the consumption of your library that it doesn’t have transitive set to false any where:

You may want to just create a new project from scratch to rule out anything else.

Lastly you might want to try out --scan, it provides a detailed report of dependency tree which might help you hunt down your issue:

You can also try dependencyInsight passing it your ext-org-json library.
You may also want to try it with the json library to see what else could be trying to pull it in.