11# JGit HTTP Server + GraalVM native image
22
3+ [ ![ Github Actions Build Status] ( https://github.com/chirontt/jgit.http.server.native/actions/workflows/gradle-build.yml/badge.svg )] ( https://github.com/chirontt/jgit.http.server.native/actions/workflows/gradle-build.yml )
4+ [ ![ Github Actions Build Status] ( https://github.com/chirontt/jgit.http.server.native/actions/workflows/maven-build.yml/badge.svg )] ( https://github.com/chirontt/jgit.http.server.native/actions/workflows/maven-build.yml )
5+
36Sample project to compile JGit HTTP server, with LFS server support, to native executable
47using GraalVM native-image utility.
58
6- [ JGit] ( http ://www .eclipse.org/jgit/ ) is a pure Java implementation of the Git version control system,
9+ [ JGit] ( https ://projects .eclipse.org/projects/technology.jgit ) is a pure Java implementation of the Git version control system,
710and is available as a library to be integrated into many projects.
811The JGit [ project] ( https://github.com/eclipse-jgit/jgit ) also implements a
912[ git server] ( https://github.com/eclipse-jgit/jgit/tree/master/org.eclipse.jgit.http.server )
@@ -54,21 +57,21 @@ To generate native executable, run the `nativeCompile` task:
5457The ` nativeCompile ` task would take a while to compile the source code and link into an executable file.
5558The resulting ` JGitHttpServer ` file is in:
5659
57- build/native-image /JGitHttpServer
60+ build/native/nativeCompile /JGitHttpServer
5861
5962(or if building on a Windows machine:
6063
61- build\native-image \JGitHttpServer.exe
64+ build\native\nativeCompile \JGitHttpServer.exe
6265
6366)
6467
6568which can then be run directly (with parameters):
6669
67- ./build/native-image /JGitHttpServer 8080 /path/to/repos /path/to/lfs/storage
70+ ./build/native/nativeCompile /JGitHttpServer 8080 /path/to/repos /path/to/lfs/storage
6871
6972(or if building on a Windows machine:
7073
71- build\native-image \JGitHttpServer.exe 8080 \path\to\repos \path\to\lfs\storage
74+ build\native\nativeCompile \JGitHttpServer.exe 8080 \path\to\repos \path\to\lfs\storage
7275
7376)
7477
@@ -88,30 +91,21 @@ To generate native executable, run the `package` task:
8891The ` package ` task would take a while to compile the source code and link into an executable file.
8992The resulting ` JGitHttpServer ` file is in:
9093
91- target/native-image/ JGitHttpServer
94+ target/JGitHttpServer
9295
9396(or if building on a Windows machine:
9497
95- target\native-image\ JGitHttpServer.exe
98+ target\JGitHttpServer.exe
9699
97100)
98101
99102which can then be run directly (with parameters):
100103
101- ./target/native-image/ JGitHttpServer 8080 /path/to/repos /path/to/lfs/storage
104+ ./target/JGitHttpServer 8080 /path/to/repos /path/to/lfs/storage
102105
103106(or if building on a Windows machine:
104107
105- target\native-image\ JGitHttpServer.exe 8080 \path\to\repos \path\to\lfs\storage
108+ target\JGitHttpServer.exe 8080 \path\to\repos \path\to\lfs\storage
106109
107110)
108111
109- ## Compressed native executable
110-
111- The resulting ` JGitHttpServer ` executable file, whether produced by Gradle or Maven build scripts,
112- can be further reduced in size via compression using the [ UPX] ( https://upx.github.io ) utility,
113- as described [ here] ( https://medium.com/graalvm/compressed-graalvm-native-images-4d233766a214 ) .
114-
115- As an example, the resulting ` JGitHttpServer.exe ` native application file produced in Windows
116- is normally 35MB in size, but is compressed to 10MB with the UPX command: ` upx --best JGitHttpServer.exe `
117-
0 commit comments