Skip to content

Commit

Permalink
#782: Added support for system properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Dec 2, 2013
1 parent c1f3623 commit 1f75fed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hawtio-maven-plugin/src/main/java/io/hawt/maven/RunMojo.java
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
Expand All @@ -29,6 +30,9 @@ public class RunMojo extends BaseMojo {
@Parameter(property = "hawtio.arguments")
String[] arguments;

@Parameter(property = "hawtio.systemProperties")
Map<String, String> systemProperties;

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
// use hawtio-app
Expand Down Expand Up @@ -87,6 +91,13 @@ protected void doExecute() throws Exception {
throw new IllegalArgumentException("Option mainClass must be specified");
}

if (systemProperties != null && !systemProperties.isEmpty()) {
for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
System.setProperty(entry.getKey(), entry.getValue());
}
getLog().info("Adding system properties: " + systemProperties);
}

final IsolatedThreadGroup threadGroup = new IsolatedThreadGroup(this, mainClass);
final Thread bootstrapThread = new Thread(threadGroup, new Runnable() {
public void run() {
Expand Down

0 comments on commit 1f75fed

Please sign in to comment.