Skip to content

Commit

Permalink
Merge pull request #41482 from gsmet/TrackConfigChangesMojo
Browse files Browse the repository at this point in the history
Generate dependency list for Develocity consumption
  • Loading branch information
gsmet authored Jun 27, 2024
2 parents c43d47e + bd97e66 commit 6621c6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<extension>
<groupId>io.quarkus.develocity</groupId>
<artifactId>quarkus-project-develocity-extension</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</extension>
</extensions>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -148,24 +147,19 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
}

if (dumpDependencies) {
final List<String> deps = new ArrayList<>();
final List<Path> 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();
}
}
Expand Down
5 changes: 3 additions & 2 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6621c6a

Please sign in to comment.