summaryrefslogtreecommitdiffstats
path: root/src/main/distrib
diff options
context:
space:
mode:
authorFlorian Zschocke <zschocke@gmx.de>2019-11-07 20:00:17 +0100
committerFlorian Zschocke <florian.zschocke@devolo.de>2019-11-07 23:45:07 +0100
commitb902e6949ea283e9e553b5b9288bb1da13193db7 (patch)
treed1c6598bfadad325b93b0521c61a0c6a76550a64 /src/main/distrib
parent1140536f6d2f97658c97cadb0c9546df8061d541 (diff)
downloadgitblit-b902e6949ea283e9e553b5b9288bb1da13193db7.tar.gz
gitblit-b902e6949ea283e9e553b5b9288bb1da13193db7.zip
For Java 9+ define the classpath instead of using a Launcher.
The (moxie and other) Launcher do not work with Java 9 and later anymore. It used to dynamically extend the classpath, misusing an internal interface of the `URLClassLoader`. This is no longer possible since Java 9, which closed that path and does not offer any way to dynamically extend the classpath during runtime. So the choice is between providing one large Jar with everything in it, providing a Jar that has the Jars in `ext` listed explicitly in its manifest, and specifying the classpath on the command line where the `ext` directory can be added and all contained jar files will be put on the classpath. The motivation for the Launcher class was to be able to simply drop new jar files into a directory and they will be picked up at the application start, without having to specify a classpath. We opt for solution three here. This way jar files can still be dropped into the ext directory, albeit the directory needs to be added to the classpath on the command line. Unfortunately using a wildcard is not possible in the manifest file. We change the calls in the script files accordingly. This seems like a good compromise, since no one will run the application manually typing the whole commandline anyway. This also does away with the splash screen, by the way. Again, doesn't seem like a big loss, as I don't think it was ever shown for the Authority. Personally, I am not convinced that it is the best way, because I don't really think that the use case of dropping whatever jar files into the `ext` directory is a valid one that happened a lot. This does not yet fix the client programs, which still use a Launcher. Maybe for them a all-in-one Jar is a better solution. Fixes #1262 Fixes #1294
Diffstat (limited to 'src/main/distrib')
-rw-r--r--src/main/distrib/linux/authority.sh2
-rw-r--r--src/main/distrib/linux/gitblit-stop.sh2
-rw-r--r--src/main/distrib/linux/gitblit.sh2
-rw-r--r--src/main/distrib/win/authority.cmd2
-rw-r--r--src/main/distrib/win/gitblit-stop.cmd2
-rw-r--r--src/main/distrib/win/gitblit.cmd2
-rw-r--r--src/main/distrib/win/installService.cmd6
7 files changed, 9 insertions, 9 deletions
diff --git a/src/main/distrib/linux/authority.sh b/src/main/distrib/linux/authority.sh
index ce5c2377..740f51a8 100644
--- a/src/main/distrib/linux/authority.sh
+++ b/src/main/distrib/linux/authority.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-java -cp gitblit.jar com.gitblit.authority.Launcher --baseFolder data
+java -cp gitblit.jar:ext/* com.gitblit.authority.GitblitAuthority --baseFolder data
diff --git a/src/main/distrib/linux/gitblit-stop.sh b/src/main/distrib/linux/gitblit-stop.sh
index 2fef2034..2a774644 100644
--- a/src/main/distrib/linux/gitblit-stop.sh
+++ b/src/main/distrib/linux/gitblit-stop.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-java -jar gitblit.jar --baseFolder data --stop
+java -cp "gitblit.jar:ext/*" com.gitblit.GitBlitServer --baseFolder data --stop
diff --git a/src/main/distrib/linux/gitblit.sh b/src/main/distrib/linux/gitblit.sh
index 7d631e72..2a52e24e 100644
--- a/src/main/distrib/linux/gitblit.sh
+++ b/src/main/distrib/linux/gitblit.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-java -jar gitblit.jar --baseFolder data
+java -cp "gitblit.jar:ext/*" com.gitblit.GitBlitServer --baseFolder data
diff --git a/src/main/distrib/win/authority.cmd b/src/main/distrib/win/authority.cmd
index f9a18640..3a27c8a9 100644
--- a/src/main/distrib/win/authority.cmd
+++ b/src/main/distrib/win/authority.cmd
@@ -1 +1 @@
-@java -cp gitblit.jar com.gitblit.authority.Launcher --baseFolder data %*
+@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.authority.GitblitAuthority --baseFolder data %*
diff --git a/src/main/distrib/win/gitblit-stop.cmd b/src/main/distrib/win/gitblit-stop.cmd
index 34f0f4be..b6bebd8a 100644
--- a/src/main/distrib/win/gitblit-stop.cmd
+++ b/src/main/distrib/win/gitblit-stop.cmd
@@ -1 +1 @@
-@java -jar gitblit.jar --stop --baseFolder data %*
+@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --stop --baseFolder data %*
diff --git a/src/main/distrib/win/gitblit.cmd b/src/main/distrib/win/gitblit.cmd
index 1a6d7e09..6cd193dd 100644
--- a/src/main/distrib/win/gitblit.cmd
+++ b/src/main/distrib/win/gitblit.cmd
@@ -1 +1 @@
-@java -jar gitblit.jar --baseFolder data %*
+@java -cp gitblit.jar;"%CD%\ext\*" com.gitblit.GitBlitServer --baseFolder data %*
diff --git a/src/main/distrib/win/installService.cmd b/src/main/distrib/win/installService.cmd
index a684ab21..ef2ba2d0 100644
--- a/src/main/distrib/win/installService.cmd
+++ b/src/main/distrib/win/installService.cmd
@@ -23,16 +23,16 @@ SET ARCH=amd64
--StdOutput=auto ^
--StdError=auto ^
--StartPath="%CD%" ^
- --StartClass=org.moxie.MxLauncher ^
+ --StartClass=com.gitblit.GitBlitServer ^
--StartMethod=main ^
--StartParams="--storePassword;gitblit;--baseFolder;%CD%\data" ^
--StartMode=jvm ^
--StopPath="%CD%" ^
- --StopClass=org.moxie.MxLauncher ^
+ --StopClass=com.gitblit.GitBlitServer ^
--StopMethod=main ^
--StopParams="--stop;--baseFolder;%CD%\data" ^
--StopMode=jvm ^
- --Classpath="%CD%\gitblit.jar" ^
+ --Classpath="%CD%\gitblit.jar;%CD%\ext\*" ^
--Jvm=auto ^
--JvmMx=1024
\ No newline at end of file