-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
190 lines (185 loc) · 9.01 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.chirontt.jgit</groupId>
<artifactId>jgit.http.server.native</artifactId>
<version>6.10.0</version>
<packaging>jar</packaging>
<name>JGitHttpServer</name> <!-- name of the resulting native executable -->
<description>JGit HTTP server's native executable built by GraalVM</description>
<properties>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jgit.release.version>6.10.0.202406032230-r</jgit.release.version>
<jetty.version>10.0.22</jetty.version>
<slf4j.version>2.0.13</slf4j.version>
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
<!-- main class name for exec:exec plugin task -->
<exec.mainClass>com.github.chirontt.gitserver.JGitHttpServer</exec.mainClass>
<!-- default values for server port, path to git repos, and path to LFS storage -->
<exec.port>8080</exec.port>
<exec.base-path>/git</exec.base-path>
<exec.lfs-path>/git-lfs-storage</exec.lfs-path>
<!-- system properties for the application when run by exec:exec command;
can be specified on the command line with -Dsys.props="..."
-->
<sys.props></sys.props>
<!-- packages/classes to be initialized at native image build time -->
<build.time.init>
com.google.gson,javax.servlet,org.eclipse.jetty,org.eclipse.jgit,org.slf4j
</build.time.init>
<!-- packages/classes to be initialized at native image run time -->
<run.time.init>
org.eclipse.jgit.internal.storage.file.WindowCache,org.eclipse.jgit.lib.internal.WorkQueue,org.eclipse.jgit.lib.RepositoryCache,org.eclipse.jgit.transport.HttpAuthMethod
</run.time.init>
<!-- packages/classes to be re-initialized at native image run time -->
<!-- all org.eclipse.jgit classes are initialized at build time
(specified above), but due to SecureRandom seeding
in their static initialization blocks, some JGit classes need be
re-initialized at native image run time -->
<run.time.re.init>
org.eclipse.jgit.util.FileUtils:rerun
</run.time.re.init>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.http.server</artifactId>
<version>${jgit.release.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.lfs.server</artifactId>
<version>${jgit.release.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<!-- GraalVM's agent to generate (or merge with) native-image configuration files -->
<!-- argument>-agentlib:native-image-agent=config-merge-dir=src/main/resources/META-INF/native-image</argument -->
<argument>${sys.props}</argument>
<argument>-classpath</argument>
<classpath/>
<argument>${exec.mainClass}</argument>
<argument>${exec.port}</argument>
<argument>${exec.base-path}</argument>
<argument>${exec.lfs-path}</argument>
</arguments>
</configuration>
</plugin>
<!-- create a stand-alone executable uber jar including all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>no-deps</shadedClassifierName>
<filters>
<filter>
<!-- exclude files that sign a jar -->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.DSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${exec.mainClass}</Main-Class>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<!-- execution>
<id>test-native</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution -->
<execution>
<phase>package</phase>
<goals>
<goal>compile-no-fork</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>${project.name}</imageName>
<mainClass>${exec.mainClass}</mainClass>
<debug>false</debug>
<verbose>true</verbose>
<fallback>false</fallback>
<buildArgs>
<buildArg>--enable-url-protocols=http,https</buildArg>
<buildArg>--initialize-at-build-time=${build.time.init}</buildArg>
<buildArg>--initialize-at-run-time=${run.time.init}</buildArg>
<buildArg>-H:ClassInitialization=${run.time.re.init}</buildArg>
<buildArg>--native-image-info</buildArg>
<buildArg>-march=compatibility</buildArg> <!-- only available in GraalVM for JDK 17+ -->
<!-- buildArg>-H:+TraceNativeToolUsage</buildArg -->
</buildArgs>
<skip>false</skip>
<!-- use the uber jar for native image compiling
if long classpath is a problem in Windows
-->
<!-- classpath>
<param>
${project.build.directory}/${project.artifactId}-${project.version}-no-deps.jar
</param>
</classpath -->
</configuration>
</plugin>
</plugins>
</build>
</project>