暂时废弃GraalVM Native Image

这东西太折磨人了,而且我本地设备还编译不了
用Github Codespace编译 -> 测试 -> 发现反射爆炸又要加规则 -> 重新编译
这一套流程跑一次半个小时没了,跑之前还无法预知到底要弄几次
This commit is contained in:
TheWhiteDog9487
2026-07-30 16:54:16 +08:00
parent 8420843068
commit 737e2a5def
3 changed files with 47 additions and 45 deletions
+34 -33
View File
@@ -2,6 +2,7 @@ name: 构建
on:
workflow_dispatch:
push:
pull_request:
jobs:
build-jar:
@@ -24,36 +25,36 @@ jobs:
with:
name: WebAPI Jar
path: build/libs/*boot*.jar
build-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: 签出仓库
uses: actions/checkout@v7
- name: 安装GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '25'
distribution: 'liberica'
- name: 让gradlew可执行
if: runner.os != 'Windows'
run: chmod +x ./gradlew
- name: 构建原生镜像
if: runner.os == 'Windows'
env:
# Needed for Windows; to resolve issue with temp folder during native image build, due to relativization
# problem when different drives are used, such as in GHA runners.
# https://github.com/graalvm/native-build-tools/issues/754
# https://github.com/bric3/jufmt/commit/feb040f159b9a5168d677455218b787d9b644ee2
GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }}
run: ./gradlew nativeCompile
- name: 构建原生镜像
if: runner.os != 'Windows'
run: ./gradlew nativeCompile
- name: 上传构建产物
uses: actions/upload-artifact@v7
with:
name: WebAPI Native Image ${{ runner.os }} ${{ runner.arch }}
path: build/native/nativeCompile/*
# build-native:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macos-latest, windows-latest, ubuntu-latest]
# steps:
# - name: 签出仓库
# uses: actions/checkout@v7
# - name: 安装GraalVM
# uses: graalvm/setup-graalvm@v1
# with:
# java-version: '25'
# distribution: 'liberica'
# - name: 让gradlew可执行
# if: runner.os != 'Windows'
# run: chmod +x ./gradlew
# - name: 构建原生镜像
# if: runner.os == 'Windows'
# env:
# # Needed for Windows; to resolve issue with temp folder during native image build, due to relativization
# # problem when different drives are used, such as in GHA runners.
# # https://github.com/graalvm/native-build-tools/issues/754
# # https://github.com/bric3/jufmt/commit/feb040f159b9a5168d677455218b787d9b644ee2
# GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }}
# run: ./gradlew nativeCompile
# - name: 构建原生镜像
# if: runner.os != 'Windows'
# run: ./gradlew nativeCompile
# - name: 上传构建产物
# uses: actions/upload-artifact@v7
# with:
# name: WebAPI Native Image ${{ runner.os }} ${{ runner.arch }}
# path: build/native/nativeCompile/*
+12 -11
View File
@@ -9,11 +9,11 @@ plugins {
id("org.springframework.boot") version "4.1.0"
id("io.spring.dependency-management") version "1.1.7"
id("org.hibernate.orm") version "7.4.1.Final"
id("org.graalvm.buildtools.native") version "1.1.1"
// id("org.graalvm.buildtools.native") version "1.1.1"
}
group = "xyz.thewhitedog9487"
version = "0.8.0"
version = "0.8.1"
java {
toolchain {
@@ -48,22 +48,22 @@ dependencies {
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
kapt("org.springframework.boot:spring-boot-configuration-processor")
testImplementation("org.springframework.boot:spring-boot-starter-actuator-test")
testImplementation("org.springframework.boot:spring-boot-starter-data-jpa-test")
// testImplementation("org.springframework.boot:spring-boot-starter-actuator-test")
// testImplementation("org.springframework.boot:spring-boot-starter-data-jpa-test")
// testImplementation("org.springframework.boot:spring-boot-starter-data-redis-test")
// testImplementation("org.springframework.boot:spring-boot-starter-jdbc-test")
// testImplementation("org.springframework.boot:spring-boot-starter-restclient-test")
// testImplementation("org.springframework.boot:spring-boot-starter-security-oauth2-authorization-server-test")
// testImplementation("org.springframework.boot:spring-boot-starter-security-oauth2-client-test")
// testImplementation("org.springframework.boot:spring-boot-starter-security-oauth2-resource-server-test")
testImplementation("org.springframework.boot:spring-boot-starter-security-test")
testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
// testImplementation("org.springframework.boot:spring-boot-starter-security-test")
// testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
// testImplementation("org.springframework.boot:spring-boot-starter-websocket-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testCompileOnly("org.projectlombok:lombok")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testAnnotationProcessor("org.projectlombok:lombok")
testImplementation(kotlin("test"))
// testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
// testCompileOnly("org.projectlombok:lombok")
// testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// testAnnotationProcessor("org.projectlombok:lombok")
// testImplementation(kotlin("test"))
implementation("io.github.oshai:kotlin-logging-jvm:7.0.3")
implementation("org.hibernate.orm:hibernate-community-dialects")
@@ -107,6 +107,7 @@ tasks.withType<KotlinCompile>().configureEach {
freeCompilerArgs.add("-Xannotation-default-target=param-property")
}
}
kapt {
keepJavacAnnotationProcessors = true
}
@@ -21,7 +21,7 @@ class OpenApiConfiguration {
.contact(Contact()
.name("TheWhiteDog9487")
.url("https://www.github.com/TheWhiteDog9487/WebAPI"))
.version("0.8.0")
.version("0.8.1")
.license(License()
.name("WTFPL")
.url("https://spdx.org/licenses/WTFPL")) )