Created
October 25, 2016 07:12
-
-
Save donovanmuller/6c03dfaeccd21cc6e95663ddda0eb6af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
/** | |
* Builds the execution command for an application. | |
* | |
* @param request the request for the application to execute | |
* @return the build command as a string array | |
*/ | |
private String[] buildExecutionCommand(AppDeploymentRequest request) { | |
ArrayList<String> commands = new ArrayList<String>(); | |
commands.add(properties.getJavaCmd()); | |
Map<String, String> deploymentProperties = request.getDeploymentProperties(); | |
// Adds Java System Properties (ie -Dmy.prop=val) before main class or -jar | |
if (deploymentProperties.containsKey("JAVA_OPTS")) { | |
String[] javaOpts = StringUtils.tokenizeToStringArray(deploymentProperties.get("JAVA_OPTS"), ","); | |
commands.addAll(Arrays.asList(javaOpts)); | |
} | |
// Below allows passing JAVA_OPTS via Data Flow | |
Map<String, String> appProperties = request.getDefinition().getProperties(); | |
if (appProperties.containsKey("JAVA_OPTS")) { | |
String[] javaOpts = StringUtils.tokenizeToStringArray(appProperties.get("JAVA_OPTS"), ","); | |
commands.addAll(Arrays.asList(javaOpts)); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment