joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
http://www.jsonschema2pojo.org
Apache License 2.0
6.24k stars 1.66k forks source link

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

Open Lionertic opened 1 year ago

Lionertic commented 1 year ago

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

unkish commented 1 year ago

Hi

Does the project have any of these:

As per JsonSchemaPlugin.groovy exception is throw if none of the below evaluates to true: https://github.com/joelittlejohn/jsonschema2pojo/blob/98c85ce4d4b9333bafae2c18eca5637ea6a7c5da/jsonschema2pojo-gradle-plugin/src/main/groovy/org/jsonschema2pojo/gradle/JsonSchemaPlugin.groovy#L33 https://github.com/joelittlejohn/jsonschema2pojo/blob/98c85ce4d4b9333bafae2c18eca5637ea6a7c5da/jsonschema2pojo-gradle-plugin/src/main/groovy/org/jsonschema2pojo/gradle/JsonSchemaPlugin.groovy#L35

joelittlejohn commented 1 year ago

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.