Search code examples
swagger-codegenswagger-codegen-maven-plugin

Swagger-codegen-maven: Change where files are generated to


I'm currently using swagger-codegen through the maven plugin: https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin. I've set the place where I want my api files to be generated with the <apiPackage></apiPackage> field in my pom.xml. But when I generate my apis, it gets put in src/main/java/<apiPackage>. I would like to know where is src/main/java declared as part of the path and if it can be changed.


Solution

  • src/main/java is a Maven convention.

    This folder structure is hard-coded in Swagger Codegen's code and cannot be changed.