OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.36k stars 6.46k forks source link

[REQ][Java] Produce sources jar for non-Android projects #1817

Open tobymurray opened 5 years ago

tobymurray commented 5 years ago

Is your feature request related to a problem? Please describe.

The generated Java projects can produce a jar, that jar can be used as a dependency in another project. When consuming that jar, productivity suffers a bit because the sources are not available via a standard dependency management tool (gradle/maven/ivy). This means a user has to either look at the class file, or open up the generated project to see the source

Describe the solution you'd like

In addition the the jar containing compiled Java code, produce a source jar that contains the raw source code.

Describe alternatives you've considered

Opening the generated project any time the source needs to be read

Additional context

This is already possible for (some?) Java projects if the target is Android, but is not implemented for non-Android projects. See here for example.

wing328 commented 3 years ago

Either one uses the customized templates, add an option (not prefer) or simply make it as the default.

Would the first option meet your requirement?