Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a mojo parameter to allow quarkus:dev to specify the add-modules clause #28395

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ public class DevMojo extends AbstractMojo {

@Parameter(defaultValue = "${open-lang-package}")
private boolean openJavaLang;

/**
* Allows configuring the modules to add to the application.
* The listed modules will be added using: {@code --add-modules m1,m2...}.
*/
@Parameter(defaultValue = "${add-modules}")
private List<String> modules;

/**
* Whether the JVM launch, in debug mode, should be suspended. This parameter is only
* relevant when the JVM is launched in {@link #debug debug mode}. This parameter supports the
Expand Down Expand Up @@ -985,6 +993,12 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
builder.jvmArgs("java.base/java.lang=ALL-UNNAMED");
}

if (modules != null && !modules.isEmpty()) {
String mods = String.join(",", this.modules);
builder.jvmArgs("--add-modules");
builder.jvmArgs(mods);
}

builder.projectDir(project.getFile().getParentFile());

Properties projectProperties = project.getProperties();
Expand Down