Skip to content

Property to tell to Tomcat to map JARs in WEB-INF/lib or WEB-INF/classes #422

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

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

RoiSoleil
Copy link
Contributor

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.`

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.`
@alitokmen
Copy link
Contributor

Thank you for the implementation, after accepting the PR I'll do a couple changes, namely:

  • Adding the new property in the capabilities
  • Have a default value for the property

I'll also create the associated JIRA so we know this is coming with version 1.10.11.

@alitokmen alitokmen merged commit 25ffdb0 into codehaus-cargo:master Nov 27, 2023
@RoiSoleil
Copy link
Contributor Author

Thx for the really quick merge !!!! Do you know when the next release will be ?

@alitokmen
Copy link
Contributor

alitokmen commented Nov 28, 2023

Sure, releasing version 1.10.11 now 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants