From 95d720b39e590c7fac11b6d7f559f97faf87b4e4 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 26 Jun 2024 17:59:45 +0200 Subject: [PATCH 1/2] Generate dependency list for Develocity consumption We used to build the hashes ourselves but it's best to use the Develocity infrastructure for that. Fixes #39256 --- .../quarkus/maven/TrackConfigChangesMojo.java | 18 ++++++------------ docs/src/main/asciidoc/config-reference.adoc | 5 +++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java index 71227c3dd1db5..7a71a932e810d 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/TrackConfigChangesMojo.java @@ -12,7 +12,6 @@ import java.util.Collections; import java.util.List; import java.util.Properties; -import java.util.zip.Adler32; import java.util.zip.Checksum; import org.apache.maven.plugin.MojoExecutionException; @@ -148,24 +147,19 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException { } if (dumpDependencies) { - final List deps = new ArrayList<>(); + final List deps = new ArrayList<>(); for (var d : curatedApplication.getApplicationModel().getDependencies(DependencyFlags.DEPLOYMENT_CP)) { - StringBuilder entry = new StringBuilder(d.toGACTVString()); - if (d.isSnapshot()) { - var adler32 = new Adler32(); - updateChecksum(adler32, d.getResolvedPaths()); - entry.append(" ").append(adler32.getValue()); + for (Path resolvedPath : d.getResolvedPaths()) { + deps.add(resolvedPath.toAbsolutePath()); } - - deps.add(entry.toString()); } Collections.sort(deps); final Path targetFile = getOutputFile(dependenciesFile, launchMode.getDefaultProfile(), - "-dependency-checksums.txt"); + "-dependencies.txt"); Files.createDirectories(targetFile.getParent()); try (BufferedWriter writer = Files.newBufferedWriter(targetFile)) { - for (var s : deps) { - writer.write(s); + for (var dep : deps) { + writer.write(dep.toString()); writer.newLine(); } } diff --git a/docs/src/main/asciidoc/config-reference.adoc b/docs/src/main/asciidoc/config-reference.adoc index b5a5b0f87ef21..213eac8b77a95 100644 --- a/docs/src/main/asciidoc/config-reference.adoc +++ b/docs/src/main/asciidoc/config-reference.adoc @@ -744,8 +744,9 @@ It will log the changed options and save the current values of each of the optio ==== Dump Quarkus application dependencies -In addition to dumping configuration values, `track-config-changes` goal also dumps all the Quarkus application dependencies, including Quarkus build time dependencies, along with their checksums (Adler32). This file could be used to check whether Quarkus build classpath has changed since the previous run. -By default, the dependency checksums will be stored under `target/quarkus-prod-dependency-checksums.txt` file. A different location could be configured using plugin parameters. +In addition to dumping configuration values, `track-config-changes` goal also dumps all the Quarkus application dependencies, including Quarkus build time dependencies. +This file could be used to check whether Quarkus build classpath has changed since the previous run, for instance together with Develocity's ability to checksum a classpath. +By default, the list of dependencies will be stored under `target/quarkus-prod-dependencies.txt` file. A different location could be configured using plugin parameters. ==== Dump current build configuration when the recorded configuration isn't found From bd97e66aff9cbc2f1ba64a414fe88391f7288e78 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 27 Jun 2024 15:27:05 +0200 Subject: [PATCH 2/2] Upgrade quarkus-project-develocity-extension to 1.1.2 --- .mvn/extensions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 04bed761c79c1..670af71ae0fb7 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -17,6 +17,6 @@ io.quarkus.develocity quarkus-project-develocity-extension - 1.1.1 + 1.1.2