in support/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateDependencyListMojo.java [68:93]
public void execute() throws MojoExecutionException, MojoFailureException {
final Path output = Paths.get(this.outputFile);
try {
if (Files.notExists(output.getParent())) {
Files.createDirectories(output.getParent());
}
} catch (IOException e) {
throw new MojoExecutionException("Exception while generating dependencies list", e);
}
try (Writer writer = Files.newBufferedWriter(output, StandardCharsets.UTF_8)) {
List<Map<String, String>> deps = project.getArtifacts().stream()
.filter(this::isCompileOrRuntime)
.map(this::artifactToMap)
.collect(Collectors.toList());
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Yaml yaml = new Yaml(options);
yaml.dump(Collections.singletonMap("dependencies", deps), writer);
} catch (IOException e) {
throw new MojoExecutionException("Exception while generating dependencies list", e);
}
}