Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding javaType to an enum causes ClassAlreadyExistsException on repeated generation #1630

Open
LitschiW opened this issue Sep 5, 2024 · 2 comments

Comments

@LitschiW
Copy link

LitschiW commented Sep 5, 2024

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.

@LitschiW LitschiW changed the title Adding javaType to an enum causes ClassAlreadyExistsException Adding javaType to an enum causes ClassAlreadyExistsException on repeated generation Sep 5, 2024
@LitschiW
Copy link
Author

LitschiW commented Sep 5, 2024

btw this also happens when one does

mvn clean compile
mvn test

@LitschiW
Copy link
Author

Probably fixed with #1597 in 1.2.2.
I will check this out and report back.

see also #1555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant