-
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
jib packages spring boot devtools #2336
Comments
Yeah that makes sense, our logic considers it a runtime dependency. We're not checking for optional. How would this work in a container environment? Someone would inject the dependency at runtime? |
Someone asked this before: #1254 (comment) Before we start, let's get clear about an I've seen people mistakenly assume that the
Therefore, it is correct for Maven and Jib to include To properly resolve this issue, the user should correctly set up the (UPDATE) X-ref: GoogleContainerTools/jib-extensions#31 (comment) |
Oh this is more about development vs deployment. Anyway, it still seems within the scope of optional use as an exclusionary mechanism for packaging. |
how can we resolve this? thinking of..
|
As a workaround use this solution https://blog.frankel.ch/spring-devtools-jib-intellij-idea/ |
Yeah, profiles should be the way to go. |
We have published a Jib extension for Spring Boot (Maven and Gradle) that covers this issue. You can apply the extension on recent Jib versions. DetailsAs discussed in this thread and #1254, Jib is working as intended to package |
For future reference, I solved the issue with maven profile & scope. I have two profiles local (active by default for local development) & cloud in my
When scope is
Then build my docker image with
|
For future reference: When using the Gradle plugin Example in build.gradle:
The referenced constant is not public, which is why I've created an issue at the spring boot project: spring-projects/spring-boot#26686 Instead of referencing the constant, you may just as well just use the string |
update: use jib-spring-boot-extension to exclude spring-boot-devtools |
cuz the existence of spring-boot-devtools causes the following exception: java.lang.ClassCastException: class com.jmsoftware.maf.authcenter.role.entity.RoleExcelBean cannot be cast to class com.jmsoftware.maf.authcenter.role.entity.RoleExcelBean (com.jmsoftware.maf.authcenter.role.entity.RoleExcelBean is in unnamed module of loader 'app'; com.jmsoftware.maf.authcenter.role.entity.RoleExcelBean is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @4ba1c32c) https://stackoverflow.com/questions/57750294/class-loader-error-unnamed-module-of-loader-org-springframework-boot-devtools GoogleContainerTools/jib#2336
In the latest version |
This is not only about |
Environment:
Description of the issue:
I created a Spring Boot app w/ devtools dependency:
In the resulting image, devtool is actually activated. The dependency is in the image's
/app/libs
directory.Expected behavior:
Optional dependency ignored? Spring Boot's plugin excludes devtool by default.
https://docs.spring.io/spring-boot/docs/2.2.5.RELEASE/maven-plugin/repackage-mojo.html
Steps to reproduce:
jib-maven-plugin
Configuration:Log output:
Additional Information:
The text was updated successfully, but these errors were encountered: