我有幾個swagger yaml文件,我想在編譯時使用maven生成代碼。這是我的代碼: <plugins> <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.3.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/src/main/resources/*.yaml</inputSpec> <language>java</language> <configOptions> <sourceFolder>src/gen/java/main</sourceFolder> </configOptions> </configuration> </execution> </executions> </plugin> </plugins>我正在嘗試獲取資源中的所有 yaml 文件作為輸入:<inputSpec>${project.basedir}/src/main/resources/*.yaml</inputSpec>但這不起作用,我遇到了這個錯誤:failed to read resource listingjava.io.FileNotFoundException: C:\Projets\www\codegen\src\main\resources\*.yaml (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)任何想法 ?
1 回答

隔江千里
TA貢獻1906條經(jīng)驗 獲得超10個贊
我的問題通過使用多次執(zhí)行得到解決,如下所示:
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.4.5</version>
<executions>
<execution>
<id>a</id> .....
</execution>
<execution>
<id>b</id> .....
</execution>
<execution>
<id>c</id> .....
</execution>
</executions>
</plugin>
添加回答
舉報
0/150
提交
取消