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

systemPropertyVariables configuration option #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.Map;

import static java.nio.file.Files.readAllBytes;

Expand Down Expand Up @@ -64,6 +66,11 @@ public abstract class BaseVertxMojo extends AbstractMojo {
*/
protected File modsDir = new File("target/mods");

/**
* List of system properties to set when running a module.
*/
protected Map<String, String> systemPropertyVariables = Collections.EMPTY_MAP;

protected JsonObject getConf() {
JsonObject config = null;
final String confContent = readConfigFile(configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;

import static java.lang.Long.MAX_VALUE;
Expand Down Expand Up @@ -67,6 +68,9 @@ public void execute() throws MojoExecutionException {
protected void doExecute(URL[] classpath) throws MojoExecutionException {

try {
for (final Map.Entry<String, String> entry : systemPropertyVariables.entrySet()) {
System.setProperty(entry.getKey(), entry.getValue());
}
System.setProperty("vertx.mods", modsDir.getAbsolutePath());
final PlatformManager pm = PlatformLocator.factory.createPlatformManager();
final CountDownLatch latch = new CountDownLatch(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.vertx.java.core.Handler;
import org.vertx.java.platform.PlatformManager;

import java.util.Map;
import java.util.concurrent.CountDownLatch;

import static java.lang.Long.MAX_VALUE;
Expand Down Expand Up @@ -43,6 +44,9 @@ public class VertxRunModMojo extends BaseVertxMojo {
public void execute() throws MojoExecutionException {

try {
for (final Map.Entry<String, String> entry : systemPropertyVariables.entrySet()) {
System.setProperty(entry.getKey(), entry.getValue());
}
System.setProperty("vertx.mods", modsDir.getAbsolutePath());
final PlatformManager pm = factory.createPlatformManager();
final CountDownLatch latch = new CountDownLatch(1);
Expand Down