How does Gradle resolve plugins not listed in the Gradle Plugin Portal?

Viewed 106

In the spring-security project, in the build.gradle file, the following plugins are made available:

apply plugin: 'io.spring.nohttp'
apply plugin: 'locks'
apply plugin: 'io.spring.convention.root'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.springframework.security.update-dependencies'
apply plugin: 'org.springframework.security.sagan'
apply plugin: 'org.springframework.github.milestone'
apply plugin: 'org.springframework.github.changelog'

About the first plugin in the list (io.spring.nohttp) - in the Gradle - Plugins page, if in the Search Gradle plugins text field is used the io.spring.nohttp term, appears the io.spring.nohttp result - and can be opened the Owner: Spring IO, where appears many plugins of the same owner. If you open in a new tab page for some of them, you are going to observe it works with two different accounts in GitHub - for example:

So, I can analyze and understand how each plugin works or what it does.

For other plugin - org.jetbrains.kotlin.jvm - it happens the same experience shared above

Reason of this post: for many of the others plugins, if I try to search other plugin, for example about Sagan - if in the textfield is used the org.springframework.security.sagan term, it does not return a result (even if only the sagan term is used) - but I know that exists in GitHub the spring-io/sagan project, is it the plugin right?

So how is resolved the plugins that "theoretically" does not exist in the Gradle Plugins page?

1 Answers

Some of the plugins defined by spring-security are not published to the Gradle Plugin Portal, nor are they in any other repository. However, it works because projects can define custom plugins using the buildSrc directory also.

For example, the plugin with ID org.springframework.security.sagan is defined in the respective buildSrc/build.gradle:

gradlePlugin {
    plugins {
        sagan {
            id = "org.springframework.security.sagan"
            implementationClass = "org.springframework.gradle.sagan.SaganPlugin"
        }
    }
}

spring-io/sagan itself is not a Gradle plugin.

Read more about the mechanics in the official Gradle docs:

Related