Skip to content

Commit 40c30dd

Browse files
davidbilgewing328
authored andcommitted
Fix inputSpec for multi module builds (#7883)
Prefix path to `inputSpec` with maven's `${project.basedir}`. The codegen-maven-plugin will look inside the current working directory so whether a relative path works or not is depending on where the maven build is invoked from. Using `${project.basedir}` makes the path absolute.
1 parent ea2474d commit 40c30dd

File tree

1 file changed

+2
-2
lines changed
  • modules/swagger-codegen-maven-plugin

1 file changed

+2
-2
lines changed

modules/swagger-codegen-maven-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
1818
<goal>generate</goal>
1919
</goals>
2020
<configuration>
21-
<inputSpec>src/main/resources/api.yaml</inputSpec>
21+
<inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
2222
<language>java</language>
2323
<configOptions>
2424
<sourceFolder>src/gen/java/main</sourceFolder>
@@ -76,7 +76,7 @@ Specifying a custom generator is a bit different. It doesn't support the classpa
7676
<goal>generate</goal>
7777
</goals>
7878
<configuration>
79-
<inputSpec>src/main/resources/yaml/yamlfilename.yaml</inputSpec>
79+
<inputSpec>${project.basedir}/src/main/resources/yaml/yamlfilename.yaml</inputSpec>
8080
<!-- language file, like e.g. JavaJaxRSCodegen shipped with swagger -->
8181
<language>com.my.package.for.GeneratorLanguage</language>
8282
<templateDirectory>myTemplateDir</templateDirectory>

0 commit comments

Comments
 (0)