root-projec
ㄴ sub1-project
build.gradle
ㄴ sub2-project
build.gradle
build.gradle
I'm trying to build all subprojects as jibs in the root project.
The following script is the build.gradle file of the root and sub modules.
...
jib {
from {
image = "eclipse-temurin:17"
}
to {
image = "abc/${project.name}:${project.version}"
tags = ["latest"]
}
}
cd root-project
./gradlew jib
Execution failed for task ':jib'.
> com.google.cloud.tools.jib.plugins.common.MainClassInferenceException: Main class was not found, perhaps you should add a `mainClass` configuration to jib
Of course there are no classes in the root project. Why do you want to include the main class in the root project when building the jib? I'd like to find a way to exclude this.
Additionally, is there any way to build with jib when building with a specific profile as follows?
There is a way to write a script in maven, but gradle has grammatical difficulties.
./gradlew clean build -P build-docker-image