You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We got a report that Jib uses the string ${start-class) when there are multiple public static void main() defined. I was able to reproduce this on a Spring Boot project. I think the string ${start-class) comes from Spring Boot.
[WARNING] 'mainClass' is not a valid Java class : ${start-class}
...
[INFO] Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*, ${start-class}]
I don't know how exactly Spring Boot determines a main class, but having a single @SpringBootApplication does help. If there is no @SpringBootApplication or multiple @SpringBootApplication annotations, then Spring Boot shows an error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:run (default-cli) on project spring-boot-k8s-example: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:run failed: Unable to find a single main class from the following candidates [hello.Foo, hello.Application] -> [Help 1]
And there seem many other ways Spring Boot determines the main class.
For now, I think we should fix this bug and show an error that multiple main classes are detected.
We got a report that Jib uses the string
${start-class)
when there are multiplepublic static void main()
defined. I was able to reproduce this on a Spring Boot project. I think the string${start-class)
comes from Spring Boot.We are supposed to fail and show an error if there are multiple main classes, but seems like this isn't working.
A workaround is to explicitly set the main class with
<container><mainClass>
.UPDATE: found a related issue #170
@reechar-goog @saturnism
The text was updated successfully, but these errors were encountered: