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

a required class is missing during build #28

Closed
wwang2016 opened this issue Apr 26, 2019 · 5 comments
Closed

a required class is missing during build #28

wwang2016 opened this issue Apr 26, 2019 · 5 comments

Comments

@wwang2016
Copy link

Hi,

I got the following error while trying to build the project and generate the api document. The api document was not generated.

Execution default of goal io.openapitools.swagger:swagger-maven-plugin:2.0.3:generate failed: A required class was missing while executing io.openapitools.swagger:swagger-maven-plugin:2.0.3:generate: org/apache/deltaspike/data/api/EntityRepository

However, the class file EntityRepository exists

Do you see any reason?

Thanks,

Wayne

@langecode
Copy link
Member

langecode commented Apr 28, 2019

Can you run this with -X to get the entire stacktrace? I am a bit uncertain where in the process you get the exception. It might be a variation of #25

@wwang2016
Copy link
Author

Hi,

The following is the error:

[ERROR] Failed to execute goal io.openapitools.swagger:swagger-maven-plugin:2.0.3:generate (default) on project: Execution default of goal io.openapitools.swagger:swagger-maven-plugin:2.0.3:generate failed: A required class was missing while executing io.openapitools.swagger:swagger-maven-plugin:2.0.3:generate: org/apache/deltaspike/data/api/EntityRepository
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.openapitools.swagger:swagger-maven-plugin:2.0.3
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/wayne.wang/.m2/repository/io/openapitools/swagger/swagger-maven-plugin/2.0.3/swagger-maven-plugin-2.0.3.jar

Thanks,

Wayne

@langecode
Copy link
Member

Can you test whether release 2.1.0 solves your problem. My guess is that #25 will solve this issue also.

@wwang2016
Copy link
Author

wwang2016 commented May 10, 2019

Hi,
This time, it ran to completion and generated source codes. The following are some issues that requireds attention

(1) The generated api definition file does not conform to OpenAPI v3 for supporting inheritance. For example, the allOf should include all elements, and not just the reference to parent class. This issue is the same as the one from another project. It would be a plus if it can be corrected
g : io.swagger.core.v3
a : swagger-maven-plugin

TextMessage:
  type: object
  properties:
    text:
      type: string
  allOf:
  - $ref: '#/components/schemas/Message'

should be:

TextMessage:
  allOf:
  - $ref: '#/components/schemas/Message'
  - type: object
    properties:
      text:
        type: string

(2) It would be better to have a configuration parameter to specify the resource class(es) so that I do not need to generate api document for all classes in the same package (resourcePackage). Note, the other solution support the sourceClasses parameter

I will continue investigate if there is any other issue

Thx!

@FunkyFlapjacks
Copy link

Hey, could you backport this (or, well, the fix to #25) to version 1.X? Getting the same error with 1.0.3 but working fine with 2.1.0+

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

3 participants