Skip to content

Commit 7f514f5

Browse files
committed
Download all dependencies by default when going offline
It is sometimes confusion and cumbersome to explicitly call the right mode before going offline. For example if you are about to board a plane you might forget to give the option to also download dependencies for dev mode. (I actually had that last week). This introduces a new option that downloads dev, test and prod dependencies and makes this the new default. This allows developers to go offline without having to specify the mode explicitly. Furthermore, adjust the usage through the docs and CI to align with the previous state. For building native images we don't need the dev and test dependencies. For running on CI we don't need the dev dependencies either.
1 parent 7e5adfb commit 7f514f5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public class GoOfflineMojo extends AbstractMojo {
6464

6565
/**
6666
* Target launch mode corresponding to {@link io.quarkus.runtime.LaunchMode} for which the dependencies should be resolved.
67-
* {@code io.quarkus.runtime.LaunchMode.TEST} is the default, since it includes both {@code provided} and {@code test}
68-
* dependency scopes.
67+
* {@code all} is the default, since it includes both {@code provided} and {@code test}
68+
* dependency scopes and also the dependencies required by dev mode.
6969
*/
70-
@Parameter(property = "mode", required = false, defaultValue = "test")
70+
@Parameter(property = "mode", required = false, defaultValue = "all")
7171
String mode;
7272

7373
@Override
@@ -82,7 +82,11 @@ public void execute() throws MojoExecutionException, MojoFailureException {
8282
final BootstrapAppModelResolver appModelResolver = new BootstrapAppModelResolver(resolver);
8383

8484
final Set<String> excludedScopes;
85-
if (mode.equalsIgnoreCase("test")) {
85+
if (mode.equals("all")) {
86+
appModelResolver.setDevMode(true);
87+
appModelResolver.setTest(true);
88+
excludedScopes = Set.of();
89+
} else if (mode.equalsIgnoreCase("test")) {
8690
appModelResolver.setTest(true);
8791
excludedScopes = Set.of();
8892
} else if (mode.equalsIgnoreCase("dev") || mode.equalsIgnoreCase("development")) {

0 commit comments

Comments
 (0)