-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'could not find or load ${start-class}' when trying this with spring boot pet clinic #170
Comments
I believe this is due to there not being a default main class provided (the spring-petclinic doesn't seem to package an executable JAR and thus, we don't find a Main-Class attribute in the maven-jar-plugin). Therefore, Spring may be setting Alternatively, one could explicitly pass in the main class to the jib-maven-plugin configuration. |
two things:
1) when we fail to discover it we should fail the build, not produce an
entrypoing that still has the placeholder.
2) what could we do to make this automatic? Scan
for `@SpringBootApplication`? That would probably slow things down. Is the
spring boot build plugin doing something that we can inspect?
…On Wed, Mar 14, 2018 at 4:04 PM Qingyang Chen ***@***.***> wrote:
I believe this is due to there not being a default main class provided
(the spring-petclinic doesn't seem to package an executable JAR and thus,
we don't find a Main-Class attribute in the maven-jar-plugin). Therefore,
Spring may be setting ${start-class} as the main class for
maven-jar-plugin, but since start-class is not defined, it doesn't get
resolved. I tried adding
<start-class>org.springframework.samples.petclinic.PetClinicApplication</start-class>
in the pom.xml properties and it seems to have worked.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#170 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHf5Ha_ruOSvA-MNS3jr7DBUksNLjMVtks5teXe2gaJpZM4SrBRg>
.
|
|
So 2 would look for a single main class? and fail if multiple are found? |
@loosebazooka Yes |
There is still the problem of when to do the main method search. If we do the search after inferring from the jar plugin, this issue still happens since Spring boot is actually setting the jar plugin's main class to If we do the search before the jar plugin, we may have the user experience a difference between running their jar and running the jibbed image. We might still need logic to detect if the main class is a valid java class. |
to reproduce:
try out:
$ git clone https://github.com/spring-projects/spring-petclinic.git
$ cd spring-petclinic
$ ./mvnw spring-boot:run
modify pom.xml to include
mvnw compile jib:build
docker pull and run
see:
'could not find or load ${start-class}'
The text was updated successfully, but these errors were encountered: