1+ <project
2+ xmlns =" http://maven.apache.org/POM/4.0.0"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5+ <modelVersion >4.0.0</modelVersion >
6+ <groupId >com.jpa.example</groupId >
7+ <artifactId >jpaEntityManager</artifactId >
8+ <version >0.0.1</version >
9+ <packaging >jar</packaging >
10+ <name >jpaEntityManager</name >
11+ <url >http://maven.apache.org</url >
12+
13+ <properties >
14+
15+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
16+ <native .maven.plugin.version>0.9.18</native .maven.plugin.version>
17+ <!-- <junit.jupiter.version>5.8.1</junit.jupiter.version>
18+ <maven.compiler.source>${java.specification.version}</maven.compiler.source>
19+ <maven.compiler.target>${java.specification.version}</maven.compiler.target> -->
20+ <nativeImageName >${project.name}</nativeImageName >
21+ <mainClass >com.jpa.example.Application</mainClass >
22+
23+ </properties >
24+
25+ <dependencies >
26+
27+ <!-- MySQL connector -->
28+ <dependency >
29+ <groupId >com.mysql</groupId >
30+ <artifactId >mysql-connector-j</artifactId >
31+ <version >8.0.31</version >
32+ </dependency >
33+
34+ <dependency >
35+ <groupId >org.eclipse.persistence</groupId >
36+ <artifactId >eclipselink</artifactId >
37+ <version >4.0.0</version >
38+ </dependency >
39+
40+ <dependency >
41+ <groupId >org.eclipse.persistence</groupId >
42+ <artifactId >org.eclipse.persistence.json</artifactId >
43+ <version >4.0.0</version >
44+ </dependency >
45+
46+ <!-- https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api -->
47+ <dependency >
48+ <groupId >jakarta.validation</groupId >
49+ <artifactId >jakarta.validation-api</artifactId >
50+ <version >3.0.2</version >
51+ </dependency >
52+
53+ <!-- Test -->
54+ <dependency >
55+ <groupId >junit</groupId >
56+ <artifactId >junit</artifactId >
57+ <version >3.8.1</version >
58+ <scope >test</scope >
59+ </dependency >
60+
61+ </dependencies >
62+
63+ <build >
64+ <sourceDirectory >src/main/java</sourceDirectory >
65+ <finalName >${project.name} </finalName >
66+ <plugins >
67+
68+ <plugin >
69+ <artifactId >maven-compiler-plugin</artifactId >
70+ <version >3.5.1</version >
71+ <configuration >
72+ <source >17</source >
73+ <target >17</target >
74+ </configuration >
75+ </plugin >
76+
77+ <plugin >
78+ <artifactId >maven-dependency-plugin</artifactId >
79+ <executions >
80+ <execution >
81+ <phase >prepare-package</phase >
82+ <goals >
83+ <goal >copy-dependencies</goal >
84+ </goals >
85+ <configuration >
86+ <outputDirectory >${project.build.directory} /libs</outputDirectory >
87+ <overWriteReleases >false</overWriteReleases >
88+ <overWriteSnapshots >false</overWriteSnapshots >
89+ <overWriteIfNewer >true</overWriteIfNewer >
90+ </configuration >
91+ </execution >
92+ </executions >
93+ </plugin >
94+
95+ <plugin >
96+ <groupId >org.apache.maven.plugins</groupId >
97+ <artifactId >maven-jar-plugin</artifactId >
98+ <version >3.3.0</version >
99+ <configuration >
100+ <archive >
101+ <manifest >
102+ <addClasspath >true</addClasspath >
103+ <classpathPrefix >libs</classpathPrefix >
104+ <mainClass >${mainClass} </mainClass >
105+ </manifest >
106+ <manifestEntries >
107+ <Class-Path >libs/</Class-Path >
108+ </manifestEntries >
109+ </archive >
110+ </configuration >
111+ </plugin >
112+
113+ <!-- fat jar-->
114+ <plugin >
115+ <groupId >org.apache.maven.plugins</groupId >
116+ <artifactId >maven-assembly-plugin</artifactId >
117+ <version >3.4.2</version >
118+
119+ <configuration >
120+ <descriptorRefs >
121+ <descriptorRef >jar-with-dependencies</descriptorRef >
122+ </descriptorRefs >
123+ <archive >
124+ <manifest >
125+ <addClasspath >true</addClasspath >
126+ <mainClass >${mainClass} </mainClass >
127+ </manifest >
128+ </archive >
129+ </configuration >
130+
131+ <executions >
132+ <execution >
133+ <id >make-assembly</id >
134+ <phase >package</phase >
135+ <goals >
136+ <goal >single</goal >
137+ </goals >
138+ </execution >
139+ </executions >
140+
141+ </plugin >
142+
143+ <plugin >
144+ <groupId >org.codehaus.mojo</groupId >
145+ <artifactId >exec-maven-plugin</artifactId >
146+ <version >3.0.0</version >
147+ <executions >
148+ <execution >
149+ <id >java-agent</id >
150+ <goals >
151+ <goal >exec</goal >
152+ </goals >
153+ <configuration >
154+ <executable >java</executable >
155+ <workingDirectory >${project.build.directory} </workingDirectory >
156+ <arguments >
157+ <argument >-classpath</argument >
158+ <classpath />
159+ <argument >${mainClass} </argument >
160+ </arguments >
161+ </configuration >
162+ </execution >
163+ <execution >
164+ <id >native</id >
165+ <goals >
166+ <goal >exec</goal >
167+ </goals >
168+ <configuration >
169+ <executable >${project.build.directory} /${nativeImageName} </executable >
170+ <workingDirectory >${project.build.directory} </workingDirectory >
171+ </configuration >
172+ </execution >
173+ </executions >
174+ </plugin >
175+
176+
177+ </plugins >
178+
179+ </build >
180+
181+ <profiles >
182+ <profile >
183+ <id >native</id >
184+ <build >
185+ <plugins >
186+ <plugin >
187+ <groupId >org.graalvm.buildtools</groupId >
188+ <artifactId >native-maven-plugin</artifactId >
189+ <version >${native.maven.plugin.version} </version >
190+ <extensions >true</extensions >
191+ <executions >
192+ <execution >
193+ <id >build-native</id >
194+ <goals >
195+ <goal >compile-no-fork</goal >
196+ </goals >
197+ <phase >package</phase >
198+ </execution >
199+ <execution >
200+ <id >test-native</id >
201+ <goals >
202+ <goal >test</goal >
203+ </goals >
204+ <phase >test</phase >
205+ </execution >
206+ </executions >
207+ <configuration >
208+ <fallback >false</fallback >
209+ <imageName >${nativeImageName} </imageName >
210+ <buildArgs >
211+ <arg >-H:DashboardDump=${project.build.directory} /jpaEntityManager -H:+DashboardAll -H:IncludeResources=test.xml -H:IncludeResources=META-INF/persistence.xml -H:IncludeResourceBundles=org.eclipse.persistence.exceptions.i18n.PersistenceUnitLoadingExceptionResource -H:IncludeResourceBundles=org.eclipse.persistence.exceptions.i18n.ValidationExceptionResource</arg >
212+ </buildArgs >
213+ <agent >
214+ <enabled >true</enabled >
215+ <options >
216+ <option >experimental-class-loader-support</option >
217+ </options >
218+ <!-- <options name="main"> <!- - main options - ->
219+ <option>access-filter-file=${basedir}/src/main/resources/access-filter.json</option>
220+ </options>
221+ <options name="test"> <!- - test options - ->
222+ <option>access-filter-file=${basedir}/src/test/resources/access-filter.json</option>
223+ </options> -->
224+ <options name =" periodic-config" > <!-- periodic-config options -->
225+ <option >config-write-period-secs=1</option >
226+ <option >config-write-initial-delay-secs=1</option >
227+ </options >
228+ </agent >
229+ </configuration >
230+ </plugin >
231+ </plugins >
232+ </build >
233+ </profile >
234+ </profiles >
235+
236+ </project >
0 commit comments