Skip to content

Commit 51d9d94

Browse files
committed
Create dir before writing report
1 parent b532117 commit 51d9d94

File tree

1 file changed

+7
-0
lines changed
  • codegen-maven-plugin/src/main/java/software/amazon/awssdk/codegen/maven/plugin

1 file changed

+7
-0
lines changed

codegen-maven-plugin/src/main/java/software/amazon/awssdk/codegen/maven/plugin/GenerationMojo.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ private <T> Optional<T> loadOptionalModel(Class<T> clzz, Path location) {
236236

237237
private void emitValidationReport(ModelValidationReport report) {
238238
Path modelsDir = sourcesDirectory.resolve("models");
239+
try {
240+
Files.createDirectories(modelsDir);
241+
} catch (IOException e) {
242+
getLog().warn(String.format("Failed to create directory %s, unable to write validation-report.json", modelsDir), e);
243+
return;
244+
}
245+
239246
try (Writer writer = Files.newBufferedWriter(modelsDir.resolve("validation-report.json"),
240247
StandardCharsets.UTF_8);) {
241248

0 commit comments

Comments
 (0)