【发布时间】:2021-01-13 03:47:03
【问题描述】:
我想玩转具有预览功能的最新 Java 15。我正在使用 Spring Boot 2.4.0-M2 和 Gradle 6.7-rc2,它们都支持 Java 15 功能。
我想使用 jib 从我的项目中构建一个 docker 映像。这是我的吊臂配置:
jib {
from {
image = 'openjdk:15-jdk'
}
to {
image = '<username>/<project>'
}
container {
jvmFlags = ['--enable-preview']
}
}
不幸的是,当我运行 ./gradlew jib 时,我收到以下错误:
Execution failed for task ':jib'.
> Records requires ASM8
这是使用--info 标志运行时的输出:
> Task :jib FAILED
Caching disabled for task ':jib' because:
Build cache is disabled
Task ':jib' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Searching for main class... Add a 'mainClass' configuration to 'jib' to improve build speed.
Could not find a valid main class from 'jar' task; looking into all class files to infer main class.
:jib (Thread[Execution worker for ':',5,main]) completed. Took 0.003 secs.
有人遇到过类似的问题吗?
【问题讨论】:
-
指定主类后生效。您可以创建一个答案,以便我接受吗?
标签: java spring-boot docker gradle jib