File tree Expand file tree Collapse file tree
src/main/java/io/openapiprocessor/maven Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121/**
2222 * run an openapi-processor.
23- * Except for id==json the generated sources are added to the compile source roots.
2423 */
2524@ Mojo (name = "process" , defaultPhase = LifecyclePhase .GENERATE_SOURCES )
2625public class ProcessMojo extends AbstractMojo {
@@ -36,6 +35,9 @@ public class ProcessMojo extends AbstractMojo {
3635 @ Parameter (required = false )
3736 private Options options ;
3837
38+ @ Parameter (required = false , defaultValue = "true" )
39+ private boolean addSourceRoot ;
40+
3941 @ Parameter (readonly = true , required = true , defaultValue = "${project}" )
4042 private MavenProject project ;
4143
@@ -54,7 +56,7 @@ public void execute () throws MojoExecutionException {
5456
5557 String targetDir = (String ) properties .computeIfAbsent (TARGET_DIR , k -> project .getBuild ().getDirectory () + File .pathSeparator + "generated-sources" + File .pathSeparator + id );
5658
57- if (! "json" . equals ( id ) ) {
59+ if (addSourceRoot ) {
5860 project .addCompileSourceRoot (targetDir );
5961 }
6062
You can’t perform that action at this time.
0 commit comments