Property to tell to Tomcat to map JARs in WEB-INF/lib or WEB-INF/classes#422
Merged
alitokmen merged 1 commit intocodehaus-cargo:masterfrom Nov 27, 2023
Merged
Property to tell to Tomcat to map JARs in WEB-INF/lib or WEB-INF/classes#422alitokmen merged 1 commit intocodehaus-cargo:masterfrom
alitokmen merged 1 commit intocodehaus-cargo:masterfrom
Conversation
Use case : Chapter Ordering in https://tomcat.apache.org/tomcat-8.0-doc/config/resources.html `Since both resources are PostResources, it might be expected that D:\Projects\external\classes will be searched for classes before D:\Projects\lib\library1.jar. However, by adding the JAR using a FileResourceSet, the JAR is mapped to /WEB-INF/lib and will be processed at application start along with the other JARs in /WEB-INF/lib. The classes from the JAR file will be added to the ClassResources which means they will be searched before the classes from D:\Projects\external\classes. If the desired behaviour is that D:\Projects\external\classes is searched before D:\Projects\lib\library1.jar then a slightly different configuration is required: <Resources> <PostResources base="D:\Projects\external\classes" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/classes"/> <PostResources base="D:\Projects\lib\library1.jar" className="org.apache.catalina.webresources.JarResourceSet" webAppMount="/WEB-INF/classes"/> </Resources> In short, the JAR file should be added as a JarResourceSet mapped to /WEB-INF/classes rather than using a FileResourceSet mapped to /WEB-INF/lib.`
Contributor
|
Thank you for the implementation, after accepting the PR I'll do a couple changes, namely:
I'll also create the associated JIRA so we know this is coming with version 1.10.11. |
Contributor
Author
|
Thx for the really quick merge !!!! Do you know when the next release will be ? |
Contributor
|
Sure, releasing version 1.10.11 now 👏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use case : Chapter Ordering in https://tomcat.apache.org/tomcat-8.0-doc/config/resources.html
`Since both resources are PostResources, it might be expected that D:\Projects\external\classes will be searched for classes before D:\Projects\lib\library1.jar. However, by adding the JAR using a FileResourceSet, the JAR is mapped to /WEB-INF/lib and will be processed at application start along with the other JARs in /WEB-INF/lib. The classes from the JAR file will be added to the ClassResources which means they will be searched before the classes from D:\Projects\external\classes. If the desired behaviour is that D:\Projects\external\classes is searched before D:\Projects\lib\library1.jar then a slightly different configuration is required:
In short, the JAR file should be added as a JarResourceSet mapped to /WEB-INF/classes rather than using a FileResourceSet mapped to /WEB-INF/lib.`