joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc

Home Page:http://www.jsonschema2pojo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to use in gradle with correct dependencies. tried the sample gradle file but got error

Lionertic opened this issue · comments

An exception occurred applying plugin request [id: 'org.jsonschema2pojo', version: '1.2.1']

Failed to apply plugin 'org.jsonschema2pojo'.
generateJsonSchema: Java or Android plugin required

commented

Hi

Does the project have any of these:

  • apply plugin: 'com.android.application'
  • apply plugin: 'com.android.library'
  • apply plugin: 'java'

As per JsonSchemaPlugin.groovy exception is throw if none of the below evaluates to true:


} else if (project.plugins.hasPlugin('com.android.application') || project.plugins.hasPlugin('com.android.library')) {

What Gradle version are you using?

From the README.md for the Gradle plugin:

For Gradle 7.3 and later, you can use the plugins DSL:
...
For Gradle 7.2.x and older, there is a bug related to the application order of plugins so you must use legacy plugin application.

Could this be the issue? I think it manifests in this way.