Could not find implementation class for plugin error when using plugin “java-gradle-plugin”
Asked Answered
F

1

6

Gradle 4.10.2

NOTE: I posted the same question in the Gradle Forum page but have had 0 traction after 1 week.

I’ve read Could not find implementation class for plugin error when using Gradle 4.1+ but I may have a different issue, but I’m not sure.

This is my first time writing a plugin so I’m just following Writing Gradle Plugins tutorial, and Gradle Plugin Development Plugin.

Here’s my plugin’s build.gradle file

apply plugin: 'java'
apply plugin: 'java-gradle-plugin'

gradlePlugin {
    plugins {
        simplePlugin {
            id = 'org.example.greeting.greeting-plugin'
            implementationClass = 'org.example.greeting.GreetingPlugin'
        }
    }
}

However when I get this when I build

$ ./gradlew clean build

**> Task :jar**

:jar: A valid plugin descriptor was found for org.example.greeting-plugin.properties but the implementation class org.example.greeting.GreetingPlugin was not found in the jar.

**BUILD SUCCESSFUL** in 0s

How can I fix it?

Famous answered 3/12, 2019 at 18:44 Comment(0)
F
0

The article has one creating a /top-level/buildSrc/src/... directory. I moved the src/ tree to just /top-level/src/... and it worked.

Famous answered 3/12, 2019 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.