-
Notifications
You must be signed in to change notification settings - Fork 14
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
Introduce BPI_TOMCAT_ADDITIONAL_JARS to enable adding JARs to CLASSPATH #375
Introduce BPI_TOMCAT_ADDITIONAL_JARS to enable adding JARs to CLASSPATH #375
Conversation
8db1bca
to
1d1cfeb
Compare
Do you have some details on the use case that this satisfies? Also, how would one get a JAR file into the build to use this functionality? I think that historically the path to take if you want to add JARs is to use the external configuration mechanism. That allows you to overlay things on top of the Tomcat install. If I'm being honest I've never cared for the external configuration feature but it serves a purpose. Is there a desire to replace that functionality? Thanks |
Agreed, the description in the pull request is a bit short. The idea is a buildpack that adds a certain jar to the classpath if needed. Potentially, there could be several buildpacks doing that.
Another buildpack can write a layer and point to that layer. It is a normal dependency. It is not meant for the user to set this environment variable. Therefor, I didn't add it to the configuration and used
The external configuration can switch the configuration, but not modify an existing one. So if you have 2 buildpacks that want to contribute to the buildpack, external configuration can't be used.
We discussed this internally quite a bit. This would be a simple and easy way to have several buildpacks adding something to the classpath. If we want something similar with configuration, we would have to modify the external configuration feature in its current form or rather "substitute" it with a more granular approach. |
@anthonydahanne I think all requested changes were adressed. @dmikusa Is the use case clear now? |
I agree that this is a much easier way to add to the classpath that external configuration it. Actually, one could even argue that external configuration might never have been intended to allow adding JAR files in the first place. In particular, external configuration allows only a single contributor. |
|
Using buildpack means to modify the |
499171f
to
eecc97c
Compare
Done.
It could contain one or many jars. Whatever should be added to the classpath.
Currently that does not work (see comment), therefor this pr.
tbh, I don't really see the problem if it supports a valid usecase straight forward. |
Right. The standard Tomcat behavior. I was probably not clear enough in my idea. The idea is to have the buildpack overlap and also use Ex:
Instead of making a new env variable someone needs to know about, and We get around the Tomcat behavior because we're taking the value of
When we add new settings, we try to keep a few things in mind.
|
A real-world example would be a buildpack which supplies a database driver and some Tomcat Datasource to be used in an application. Other examples might be JARs that need special configuration (done conveniently by a buildpack) or custom valves which must reside in Tomcat's The idea is that buildpacks write their JARs into a layer and then use Overall the name of the environment variable is not that important, but I think that using |
eecc97c
to
ed0e0a6
Compare
✅ but just remember that it's not actually restricted to being between buildpacks. A user could absolutely set that env variable.
I'm not sold on the name, but I do agree that it isn't ultimately that important. If you feel strongly and want to keep it |
Co-authored-by: Johannes Dillmann <[email protected]> Co-authored-by: Ralf Pannemans <[email protected]> Co-authored-by: Anthony Dahanne <[email protected]> Signed-off-by: Ralf Pannemans <[email protected]>
Signed-off-by: Johannes Dillmann <[email protected]> Co-authored-by: Ralf Pannemans <[email protected]> Co-authored-by: Johannes Dillmann <[email protected]>
ed0e0a6
to
77971b8
Compare
Summary
Allow
BPI_TOMCAT_ADDITIONAL_JARS
to containjar
s that will be added to the classpath viasetenv.sh
.see paketo-buildpacks/apache-tomee#200
Use Cases
This allows another buildpack(s) to contribute a
jar
that needs to be added to the tomcat classloader. The buildpack can contribute its dependency and add the location toBPI_TOMCAT_ADDITIONAL_JARS
. This can be done by several buildpacks independently without caring for one big external configuration that might contain jars you do not need.Checklist