Kotlin-gradle-plugin dependency licensing question


#1

Hi All,

I would like to use the kotlin-gradle-plugin at a company I work for, however, there are some rather strict limitations with regards to what we’re able to use. Kotlin itself is Apache 2.0 licensed, which means we can use it. All dependencies have to be available via the central maven repository as well, which gradle-api is not. You can see this here – gradle-api is listed as a dependency but clicking on it results in a 404.

So my questions are:

  • Is this a closed source, proprietary dependency?
  • If not, how is it licensed and where does the code live?
  • Would it be possible to make it available via the central maven repository?

Thanks!

Brian


#2

This jar file contains a repackaged version of the Gradle plugin API. You can find the build script that builds it here: https://github.com/JetBrains/kotlin/tree/master/libraries/tools/kotlin-gradle-plugin-core/gradle_api_jar

It doesn’t seem to make any sense to publish the code to Maven Central because it makes no sense outside of Kotlin itself.

In the future, when we rewrite the Kotlin Gradle plugin build from Maven to Gradle, this dependency will no longer be necessary.


#3

I understand that publishing it to Maven central wouldn’t make sense, unfortunately it’s a bit of a technical limitation with how we consume and verify licensing information for the 3rd party libraries we use. However, all that aside –

Are you saying that gradle-api is actually vended by the Gradle project, and simply repackaged by Kotlin? If so, do you know where the official repository for gradle-api lives?

I really appreciate your help.

Brian


#4

The Gradle API contains the method gradleApi() which returns the list of all JARs which constitute the Gradle plugin API. These JARs are built from the source code of Gradle itself, as well as from the dependencies of Gradle. The gradle-api JAR is a repackaging of all those JARs into a single .jar file.

Since the set of JARs includes the code of Gradle itself as well as its dependencies, there is no single repository where it lives; it’s a combination of code from multiple projects.


#5

Yeah, it’s complicated. Seems that Gradle guys do not want to publish those dependencies that constitute gradleApi(), so we have to consume them via Gradle.
Take a look at this thread on Gradle forum: https://discuss.gradle.org/t/gradle-api-dependency-for-plugin-development/2465/


#6

This has been immensely helpful. Thank you Dmitry and Ilya!