swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.98k stars 6.03k forks source link

maven-swagger-codegen-maven-plugin java language breaks intellij #7660

Open jnorthrup opened 6 years ago

jnorthrup commented 6 years ago

the first problem is that test-sources is assigned within the intellij IDE as a main source tree. this produces a scoping failure in maven.

I have a workaround for this to run ant-run to delete the test-sources which provide no value anyways. (because i cannot find a switch to disable test generation.)
shown here https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-gistfile1-txt-L147

a second bug surfaces, the ant-run succeeds in deleting the test dir. but maven re-runs generation before package.

shown here: https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-gistfile1-txt-L175

https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3 shows the maven transcript and the pom

a switch to disable test generation would solve the issue.

Im not sure what causes the plugin to jump the rails outside of the designated phase https://gist.github.com/jnorthrup/db1935413315b9b48249a94f01eb5de3#file-pom-xml-L49

jnorthrup commented 6 years ago

related to #7207

tyler2cr commented 3 years ago

Also related https://youtrack.jetbrains.com/issue/IDEA-214950#focus=Comments-27-3751993.0-0

Potentially the problem is with swagger-codegen plugin... as it generates ALL files inside "generated-sources" folder. "generated-test-sources" folder is NOT used at all.