Skip to content

Commit 26a0aa1

Browse files
committed
Support native image build
1 parent e5ae4f1 commit 26a0aa1

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

pom.xml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<description>sql-bulk-commands</description>
1616
<properties>
1717
<java.version>1.8</java.version>
18+
<repackage.classifier/>
19+
<spring-native.version>0.11.2</spring-native.version>
1820
</properties>
1921
<dependencies>
2022
<dependency>
@@ -40,10 +42,108 @@
4042
<plugin>
4143
<groupId>org.springframework.boot</groupId>
4244
<artifactId>spring-boot-maven-plugin</artifactId>
45+
<configuration>
46+
<classifier>${repackage.classifier}</classifier>
47+
<image>
48+
<builder>paketobuildpacks/builder:tiny</builder>
49+
<env>
50+
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
51+
</env>
52+
</image>
53+
</configuration>
4354
</plugin>
4455
</plugins>
4556
</build>
4657

58+
<repositories>
59+
<repository>
60+
<id>spring-releases</id>
61+
<name>Spring Releases</name>
62+
<url>https://repo.spring.io/release</url>
63+
<snapshots>
64+
<enabled>false</enabled>
65+
</snapshots>
66+
</repository>
67+
</repositories>
68+
<pluginRepositories>
69+
<pluginRepository>
70+
<id>spring-releases</id>
71+
<name>Spring Releases</name>
72+
<url>https://repo.spring.io/release</url>
73+
<snapshots>
74+
<enabled>false</enabled>
75+
</snapshots>
76+
</pluginRepository>
77+
</pluginRepositories>
78+
79+
<profiles>
80+
<profile>
81+
<id>native</id>
82+
<properties>
83+
<repackage.classifier>exec</repackage.classifier>
84+
<native-buildtools.version>0.9.9</native-buildtools.version>
85+
<skipTests>true</skipTests>
86+
</properties>
87+
<dependencies>
88+
<dependency>
89+
<groupId>org.springframework.experimental</groupId>
90+
<artifactId>spring-native</artifactId>
91+
<version>${spring-native.version}</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.junit.platform</groupId>
95+
<artifactId>junit-platform-launcher</artifactId>
96+
<scope>test</scope>
97+
</dependency>
98+
</dependencies>
99+
<build>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.springframework.experimental</groupId>
103+
<artifactId>spring-aot-maven-plugin</artifactId>
104+
<version>${spring-native.version}</version>
105+
<executions>
106+
<execution>
107+
<id>test-generate</id>
108+
<goals>
109+
<goal>test-generate</goal>
110+
</goals>
111+
</execution>
112+
<execution>
113+
<id>generate</id>
114+
<goals>
115+
<goal>generate</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
<plugin>
121+
<groupId>org.graalvm.buildtools</groupId>
122+
<artifactId>native-maven-plugin</artifactId>
123+
<version>${native-buildtools.version}</version>
124+
<extensions>true</extensions>
125+
<executions>
126+
<execution>
127+
<id>test-native</id>
128+
<phase>test</phase>
129+
<goals>
130+
<goal>test</goal>
131+
</goals>
132+
</execution>
133+
<execution>
134+
<id>build-native</id>
135+
<phase>package</phase>
136+
<goals>
137+
<goal>build</goal>
138+
</goals>
139+
</execution>
140+
</executions>
141+
</plugin>
142+
</plugins>
143+
</build>
144+
</profile>
145+
</profiles>
146+
47147
<distributionManagement>
48148
<repository>
49149
<id>github</id>

0 commit comments

Comments
 (0)