@@ -35,6 +35,7 @@ public class MicronautCodegen extends AbstractJavaCodegen implements BeanValidat
35
35
private static final String BASE_PACKAGE = "basePackage" ;
36
36
private static final String USE_TAGS = "useTags" ;
37
37
private static final String IMPLICIT_HEADERS = "implicitHeaders" ;
38
+ private static final String SKIP_SUPPORT_FILES = "skipSupportFiles" ;
38
39
39
40
private String title = "swagger-petstore" ;
40
41
private String configPackage = "io.swagger.configuration" ;
@@ -66,6 +67,7 @@ private void init() {
66
67
cliOptions .add (new CliOption (TITLE , "server title name or client service name" ));
67
68
cliOptions .add (new CliOption (CONFIG_PACKAGE , "configuration package for generated code" ));
68
69
cliOptions .add (new CliOption (BASE_PACKAGE , "base package (invokerPackage) for generated code" ));
70
+ cliOptions .add (new CliOption (SKIP_SUPPORT_FILES , "skip support files such as pom.xml, mvnw, etc from code generation." ));
69
71
cliOptions .add (CliOption .newBoolean (USE_TAGS , "use tags for creating interface and controller classnames" ));
70
72
cliOptions .add (CliOption .newBoolean (USE_BEANVALIDATION , "Use BeanValidation API annotations" ));
71
73
cliOptions .add (CliOption .newBoolean (IMPLICIT_HEADERS , "Use of @ApiImplicitParams for headers." ));
@@ -152,6 +154,11 @@ public void processOpts() {
152
154
this .setUseOptional (convertPropertyToBoolean (USE_OPTIONAL ));
153
155
}
154
156
157
+ boolean skipSupportFiles = false ;
158
+ if (additionalProperties .containsKey (SKIP_SUPPORT_FILES )) {
159
+ skipSupportFiles = Boolean .valueOf (additionalProperties .get (SKIP_SUPPORT_FILES ).toString ());
160
+ }
161
+
155
162
if (useBeanValidation ) {
156
163
writePropertyBack (USE_BEANVALIDATION , useBeanValidation );
157
164
}
@@ -164,14 +171,15 @@ public void processOpts() {
164
171
writePropertyBack (USE_OPTIONAL , useOptional );
165
172
}
166
173
167
- supportingFiles .add (new SupportingFile ("pom.mustache" , "" , "pom.xml" ));
168
- supportingFiles .add (new SupportingFile ("README.mustache" , "" , "README.md" ));
169
- supportingFiles .add (new SupportingFile ("mvnw" , "" , "mvnw" ));
170
- supportingFiles .add (new SupportingFile ("mvnw.cmd" , "" , "mvnw.cmd" ));
171
- supportingFiles .add (new SupportingFile ("unsupportedOperationExceptionHandler.mustache" ,
174
+ if (!skipSupportFiles ) {
175
+ supportingFiles .add (new SupportingFile ("pom.mustache" , "" , "pom.xml" ));
176
+ supportingFiles .add (new SupportingFile ("README.mustache" , "" , "README.md" ));
177
+ supportingFiles .add (new SupportingFile ("mvnw" , "" , "mvnw" ));
178
+ supportingFiles .add (new SupportingFile ("mvnw.cmd" , "" , "mvnw.cmd" ));
179
+ supportingFiles .add (new SupportingFile ("unsupportedOperationExceptionHandler.mustache" ,
172
180
(sourceFolder + File .separator + configPackage ).replace ("." , File .separator ), "UnsupportedOperationExceptionHandler.java" ));
173
- supportingFiles .add (new SupportingFile ("mainApplication.mustache" , (sourceFolder + File .separator ).replace ("." , File .separator ), "MainApplication.java" ));
174
-
181
+ supportingFiles .add (new SupportingFile ("mainApplication.mustache" , (sourceFolder + File .separator ).replace ("." , File .separator ), "MainApplication.java" ));
182
+ }
175
183
addHandlebarsLambdas (additionalProperties );
176
184
}
177
185
0 commit comments