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.
This commit is contained in:
davidbilge 2018-03-25 16:51:40 +02:00 committed by William Cheng
parent ea2474d707
commit 40c30dd2f1

View File

@ -18,7 +18,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>src/main/resources/api.yaml</inputSpec>
<inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
<language>java</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
@ -76,7 +76,7 @@ Specifying a custom generator is a bit different. It doesn't support the classpa
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>src/main/resources/yaml/yamlfilename.yaml</inputSpec>
<inputSpec>${project.basedir}/src/main/resources/yaml/yamlfilename.yaml</inputSpec>
<!-- language file, like e.g. JavaJaxRSCodegen shipped with swagger -->
<language>com.my.package.for.GeneratorLanguage</language>
<templateDirectory>myTemplateDir</templateDirectory>