[BUG] [maven] Default output path and source folder in it are not good in case of code generation for tests
Created by: rosti-il
In case of the generate-test-sources
Maven lifecycle phase the openapi-generator-maven-plugin
still uses ${project.build.directory}/generated-sources/openapi
as the default value of the output folder. This is always wrong and forces to redefine it. Let's use ${project.build.directory}/generated-test-sources/openapi
as the default value of the output folder in this case instead.
Also #6119 (closed)/#6120 introduced a useful property addTestCompileSourceRoot
that allows to use the code generated during the generate-test-sources
Maven lifecycle phase in tests. However it uses src/test/java
as the default value of the source folder in the output path. This is wrong or at least rarely needed. A much more common case is using the main generated code (src/main/java
) in tests and not tests of the generated coded in tests of the project that uses the openapi-generator-maven-plugin
.
Please review and merge #13151 that fixes this issue.