/workspace file conflicting with a classpath resource #43
-
Dear team, I noticed an unusual behaviour of a packaged Spring Boot application in a Kubernetes deployment. When this file and dir are present in the /workspace:
then it overlaps and replaces the default Spring Boot configuration file which is present here:
I guess that the entire What's would be the best place to put extra sourcemap files? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@paketo-buildpacks/java-buildpacks any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
By default, yes. When you build from source, the buildpack will run Maven/Gradle/etc. and build your JAR/WAR file. It will take that, store it, delete all your source, and then extract the contents of that file into When you build locally and The net result is that in both cases, your Not to be confusing, but there are other scenarios where this doesn't happen, like if your build produces multiple JAR files or if you include additional files from the build process, but these scenarios are less common. If you happen to be in one of these situations, then your app is run
I suspect that is a classpath ordering issue. When a resource is loaded from the classpath, it searches the classpath in order and stops looking when it finds a file, so if you have the same file in two locations on the classpath, the first location is going to win. Just guessing, but
I would not volume mount/config map things into the I would suggest that you volume map to a place that doesn't exist at all, like Hope that helps! |
Beta Was this translation helpful? Give feedback.
By default, yes.
When you build from source, the buildpack will run Maven/Gradle/etc. and build your JAR/WAR file. It will take that, store it, delete all your source, and then extract the contents of that file into
/workspace
. i.e. after build,/workspace
is your exploded JAR/WAR.When you build locally and
pack build
a JAR/WAR file (this is what happens when you use Spring Boot build tools), the JAR/WAR is extracted and the contents of it are pushed into the container at/workspace
. The buildpacks then run, augment your app and produce the run image.The net result is that in bo…