I want to play around with the newest Java 15 with preview features. I'm using Spring Boot 2.4.0-M2 and Gradle 6.7-rc2, where both of them support Java 15 features.
I want to build a docker image from my project using jib. Here's my jib configuration:
jib {
from {
image = 'openjdk:15-jdk'
}
to {
image = '<username>/<project>'
}
container {
jvmFlags = ['--enable-preview']
}
}
Unfortunately, when I'm running ./gradlew jib
I'm getting the following error:
Execution failed for task ':jib'.
> Records requires ASM8
And here's the output while running with --info
flag:
> 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.
Have anyone had a similar problem?
Regarding to the error message
Could not find a valid main class from 'jar' task
the main class is missing for this task. So you must add the main class and the process should work: