ProjectBuilder reports missing org.gradle.cli.CommandLineConverter class

I want to write some test for custom gradle plugin, when I tried to use ProjectBuilder it reports missing org.gradle.cli.CommandLineConverter

The plugin and test are placed in maven structure as whole project is using maven pom.xml, so I fetch gradle dependency from

Where is org.gradle.cli package stored?

The only supported way to build Gradle plugins is with Gradle. In this case, a ‘gradleApi()’ dependency will take care of pulling in the required dependencies. Otherwise you are on your own, and may have to track an ever changing set of dependencies.

To answer your question, it seems that ‘org.gradle.cli’ is currently published as part of ‘gradle-tooling-api’.

thank you for answering, but it seems for me that class that I’m looking for is in gradle-cli,jar but I can not find it in :frowning: Is there a way to get this dependency from some place?

‘gradle-cli.jar’ isn’t published on its own; you’d have to download and unpack a Gradle distribution to get it.

I’ve verified that ‘org.gradle.cli’ classes are part of ‘gradle-tooling-api.jar’. However, it’s not unlikely that other plugin dependencies are only available via a Gradle distribution. Hence getting hold of the distribution would be the way to go if you don’t want to use Gradle to build the plugin. It’s a dead end though, as future Gradle plugins will likely need to be built with a Gradle plugin SDK.