Skip to content

Commit ce76b9e

Browse files
committed
Expose the test deploy classpath to Develocity
In order to run tests on remote agents, Develocity needs to know all files necessary to run the tests, as well as the application under test. The deploy classpath contains dependencies that are not part of the regular Maven project model and we need to expose it in some way that Develocity can easily grab and track it.
1 parent c420c73 commit ce76b9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

devtools/maven/src/main/java/io/quarkus/maven/GenerateCodeMojo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package io.quarkus.maven;
22

3+
import java.io.File;
34
import java.io.IOException;
45
import java.lang.reflect.Method;
56
import java.nio.file.Path;
67
import java.util.List;
78
import java.util.Properties;
89
import java.util.function.Consumer;
10+
import java.util.stream.Collectors;
911

12+
import io.quarkus.bootstrap.BootstrapConstants;
1013
import org.apache.maven.plugin.MojoExecutionException;
1114
import org.apache.maven.plugin.MojoFailureException;
1215
import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -115,6 +118,12 @@ void generateCode(PathCollection sourceParents, Consumer<Path> sourceRegistrar,
115118
Path serializedTestAppModelPath = BootstrapUtils
116119
.getSerializedTestAppModelPath(Path.of(mavenProject().getBuild().getDirectory()));
117120
ApplicationModelSerializer.serialize(appModel, serializedTestAppModelPath);
121+
122+
String deployClasspath = appModel.getDependencies().stream()
123+
.flatMap(dep -> dep.getResolvedPaths().stream())
124+
.map(Path::toString)
125+
.collect(Collectors.joining(File.pathSeparator));
126+
mavenProject().getProperties().setProperty("quarkus.test.deploy.classpath", deployClasspath);
118127
} catch (IOException e) {
119128
getLog().warn("Failed to serialize application model", e);
120129
}

0 commit comments

Comments
 (0)