Skip to content

Commit c132273

Browse files
committed
Add compile-only dependencies to the dev mode compiler classpath
1 parent df87b33 commit c132273

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusCompiler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.quarkus.bootstrap.app.CuratedApplication;
2626
import io.quarkus.bootstrap.app.QuarkusBootstrap;
2727
import io.quarkus.fs.util.FileSystemProviders;
28+
import io.quarkus.maven.dependency.DependencyFlags;
2829
import io.quarkus.maven.dependency.ResolvedDependency;
2930
import io.quarkus.paths.PathCollection;
3031

@@ -67,7 +68,8 @@ public QuarkusCompiler(CuratedApplication application,
6768

6869
final boolean skipReloadableArtifacts = !application.hasReloadableArtifacts();
6970

70-
for (ResolvedDependency i : application.getApplicationModel().getRuntimeDependencies()) {
71+
for (ResolvedDependency i : application.getApplicationModel()
72+
.getDependenciesWithAnyFlag(DependencyFlags.COMPILE_ONLY | DependencyFlags.RUNTIME_CP)) {
7173
if (skipReloadableArtifacts) {
7274
paths.addAll(i.getContentTree().getRoots());
7375
} else {

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import org.gradle.api.artifacts.Configuration;
66
import org.gradle.api.tasks.Internal;
77

8+
import io.quarkus.bootstrap.app.QuarkusBootstrap;
89
import io.quarkus.deployment.dev.DevModeCommandLineBuilder;
10+
import io.quarkus.deployment.dev.DevModeContext;
911
import io.quarkus.deployment.dev.IsolatedTestModeMain;
1012
import io.quarkus.gradle.extension.QuarkusPluginExtension;
1113
import io.quarkus.runtime.LaunchMode;
@@ -22,8 +24,12 @@ public QuarkusTest(Configuration quarkusDevConfiguration, QuarkusPluginExtension
2224

2325
@Override
2426
protected void modifyDevModeContext(DevModeCommandLineBuilder builder) {
25-
builder.entryPointCustomizer(
26-
devModeContext -> devModeContext.setAlternateEntryPoint(IsolatedTestModeMain.class.getName()));
27+
builder.entryPointCustomizer(QuarkusTest::configureContinuousTesting);
28+
}
29+
30+
private static void configureContinuousTesting(DevModeContext devModeContext) {
31+
devModeContext.setMode(QuarkusBootstrap.Mode.CONTINUOUS_TEST);
32+
devModeContext.setAlternateEntryPoint(IsolatedTestModeMain.class.getName());
2733
}
2834

2935
@Override

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ protected LaunchMode getLaunchModeClasspath() {
2525

2626
@Override
2727
protected void modifyDevModeContext(DevModeCommandLineBuilder builder) {
28-
builder.entryPointCustomizer(new Consumer<DevModeContext>() {
29-
@Override
30-
public void accept(DevModeContext devModeContext) {
31-
devModeContext.setMode(QuarkusBootstrap.Mode.CONTINUOUS_TEST);
32-
devModeContext.setAlternateEntryPoint(IsolatedTestModeMain.class.getName());
33-
}
34-
});
28+
builder.entryPointCustomizer(TestMojo::configureContinuousTesting);
29+
}
30+
31+
private static void configureContinuousTesting(DevModeContext devModeContext) {
32+
devModeContext.setMode(QuarkusBootstrap.Mode.CONTINUOUS_TEST);
33+
devModeContext.setAlternateEntryPoint(IsolatedTestModeMain.class.getName());
3534
}
3635
}

0 commit comments

Comments
 (0)