-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
version: swagger-codegen-maven-plugin-2.1.5
The option "addCompileSourceRoot" is true by default.
It adds the following path as source folder to the eclipse Java Build path
target/generated-sources/swagger
However, the generated sources are located at:
target/generated-sources/swagger/src/main/java
So after running mvn eclipse:eclipse Eclipse will show build errors, the Source folder has to be corrected manually.
CodeGenMojo.java should be corrected from
project.addCompileSourceRoot(output.toString());to
String sourceJavaFolder = output.toString() + "/" + configOptions.get(CodegenConstants.SOURCE_FOLDER);
project.addCompileSourceRoot(sourceJavaFolder);However, the code above is only working if the sourceFolder is configured the plugin configuration/configOptions. To make it working without the sourceFolder configuration, the actual source folder needs to be retrieved from the Generator.
tadhgpearson and cruelfate