diff options
4 files changed, 12 insertions, 5 deletions
diff --git a/java/sca/distribution/all/src/main/release/launcher/default.config b/java/sca/distribution/all/src/main/release/launcher/default.config index c494f4caee..e5cc9b026b 100644 --- a/java/sca/distribution/all/src/main/release/launcher/default.config +++ b/java/sca/distribution/all/src/main/release/launcher/default.config @@ -1,5 +1,5 @@ classpath=modules/**
mainClass=org.apache.tuscany.sca.node.NodeMain2
--Djava.util.logging.config.file=../logging.properties
+-Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
diff --git a/java/sca/distribution/all/src/main/release/launcher/osgi.config b/java/sca/distribution/all/src/main/release/launcher/osgi.config index 01a33ee073..c8b9c57e53 100644 --- a/java/sca/distribution/all/src/main/release/launcher/osgi.config +++ b/java/sca/distribution/all/src/main/release/launcher/osgi.config @@ -1,4 +1,4 @@ classpath=modules/**
--Djava.util.logging.config.file=../logging.properties
+-Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
mainClass=org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher2
diff --git a/java/sca/distribution/all/src/main/release/launcher/unmanaged.config b/java/sca/distribution/all/src/main/release/launcher/unmanaged.config index 0791e56e1d..f289528a40 100644 --- a/java/sca/distribution/all/src/main/release/launcher/unmanaged.config +++ b/java/sca/distribution/all/src/main/release/launcher/unmanaged.config @@ -1,4 +1,4 @@ classpath=modules/**
--Djava.util.logging.config.file=../logging.properties
+-Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
mainClass=[firstArgJarManifestMainClass]
diff --git a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java index 04f2d0b906..35e6060d0f 100644 --- a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java +++ b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java @@ -55,15 +55,22 @@ public class LauncherMain { invokeMainMethod(mainClassName, classLoader, mainArgs);
}
- private static void setSystemProperties(Properties launcherProperties) {
+ private static void setSystemProperties(Properties launcherProperties) throws URISyntaxException {
for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
String pn = (String) e.nextElement();
if (pn.startsWith("-D")) {
- System.setProperty(pn.substring(2), launcherProperties.getProperty(pn));
+ System.setProperty(pn.substring(2), keywordExpand(launcherProperties.getProperty(pn)));
}
}
}
+ private static String keywordExpand(String property) throws URISyntaxException {
+ if (property.contains("{TUSCANY_HOME}")) {
+ property = property.replace("{TUSCANY_HOME}", getLauncherFolder().getParentFile().getAbsolutePath());
+ }
+ return property;
+ }
+
private static String[] getMainArgs(Properties launcherProperties) {
String[] mainArgs = (String[])launcherProperties.get(LAUNCHER_ARGS);
if (mainArgs == null) {
|