jsonschema2pojo
jsonschema2pojo copied to clipboard
Adding `javaType` to an enum causes `ClassAlreadyExistsException` on repeated generation
I have the following (and only) schema in a folder `schemas/cloudfoundry/:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"javaType": "types.cloudfoundry.SecurityLane",
"description": "The security lane of the space.",
"enum": [
"public",
"medium",
"secure",
"intra"
]
}
with the following maven plugin setup:
<version>1.2.1</version>
<configuration>
<sourceDirectory>${basedir}/schemas</sourceDirectory>
<targetPackage>types</targetPackage>
<removeOldOutput>true</removeOldOutput>
</configuration>
When running mvn clean compile test
the old output is removed accordingly. But enum will not be generated again whilst still throwing a ClassAlreadyExistsException
. This makes the Project uncompilable.
Removing the javaType
fixes this issue.