From efd5617a89c52f0e8901e0345cec99fc24a1e2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Tue, 17 Mar 2020 18:30:14 +0100 Subject: [PATCH] fix: error when running start scripts --- build.gradle | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 2e458743..7c0efaa5 100644 --- a/build.gradle +++ b/build.gradle @@ -10,11 +10,20 @@ allprojects { targetCompatibility = JavaVersion.VERSION_1_6 } - // FIXME: start scripts are not working, yet startScripts { - mainClassName = 'helma.main.launcher.Main' applicationName = 'helma' - classpath = files('launcher.jar') + classpath = files('../launcher.jar') + mainClassName = 'helma.main.launcher.Main' + defaultJvmOpts = [jettyLogLevel] + + doLast { + // Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir) + // See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012 + def unixScriptFile = file getUnixScript() + def windowsScriptFile = file getWindowsScript() + unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME') + windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%') + } } task processSource(type: Sync) {