From ee572e753fa770025a4a16c14f7fab2cd1614d53 Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Wed, 20 Oct 2021 10:14:15 +0200 Subject: [PATCH] Extensions should override codestart data --- .../devtools/codestarts/core/CodestartData.java | 14 ++++++++------ .../generateMavenWithCustomDep/pom.xml | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartData.java b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartData.java index 0c54bb9c66d67..7332137ed3b99 100644 --- a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartData.java +++ b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartData.java @@ -56,12 +56,8 @@ public static Map buildCodestartProjectData(Collection buildDependenciesData(Stream codestartsStream, String languageName, Collection extensions, Collection platforms) { final Map> depsData = new HashMap<>(); - final Set boms = platforms.stream() - .map(CodestartDep::new) - .collect(Collectors.toCollection(LinkedHashSet::new)); - final Set dependencies = extensions.stream() - .map(CodestartDep::new) - .collect(Collectors.toCollection(LinkedHashSet::new)); + final Set boms = new LinkedHashSet<>(); + final Set dependencies = new LinkedHashSet<>(); final Set testDependencies = new LinkedHashSet<>(); codestartsStream .flatMap(s -> Stream.of(s.getBaseLanguageSpec(), s.getLanguageSpec(languageName))) @@ -69,6 +65,12 @@ public static Map buildDependenciesData(Stream codest dependencies.addAll(d.getDependencies()); testDependencies.addAll(d.getTestDependencies()); }); + platforms.stream() + .map(CodestartDep::new) + .forEach(boms::add); + extensions.stream() + .map(CodestartDep::new) + .forEach(dependencies::add); depsData.put("dependencies", dependencies); depsData.put("boms", boms); depsData.put("test-dependencies", testDependencies); diff --git a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml index af09988d6473b..e8915a9efed98 100644 --- a/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml +++ b/independent-projects/tools/devtools-testing/src/test/resources/__snapshots__/QuarkusCodestartGenerationTest/generateMavenWithCustomDep/pom.xml @@ -29,6 +29,10 @@ + + io.quarkus + quarkus-arc + io.quarkus quarkus-resteasy @@ -38,10 +42,6 @@ commons-io 2.5 - - io.quarkus - quarkus-arc - io.quarkus quarkus-junit5