Hi,

I have some trouble using <resources> configuration (used though cargo maven 
plugin).

What I want to do :
I have some files in a jar in META-INF/resources folder, I have to access to 
them.
In some case I achieve to make it working but the solution is not really clean 
in my point of view.

I have reproduced my issues by only adding following to the conf/server.xml 
files in tomcat8.5.4/8.5.16 and 8.5.16 inside :
This is working : the server started and I can access to test.html (that is in 
my dependencies jar)
<Resources>
   <JarResources  base="<absolutePath>\0.0.1-SNAPSHOT" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/lib" />
  <PostResources base="<absolutePath>\target\classes" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/classes" />
</Resources>
Note that "<path>\0.0.1-SNAPSHOT" only contains one jar for this test.
This is working so it's ok but, it's really not great to add an entire folder 
of jar since I have want to add only a specific one.

This is not working : the server started and but I can't access to test.html 
(library.jar/META-INF/resources/test.html)
<Resources>
   <JarResources  base="<absolutePath>\0.0.1-SNAPSHOT\library.jar" 
className="org.apache.catalina.webresources.JarResourceSet" 
webAppMount="/WEB-INF/lib" />
  <PostResources base="<absolutePath>\target\classes" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/classes" />
</Resources>
Other case that are not working :
<Resources>
   <JarResources  base="<absolutePath>\ 0.0.1-SNAPSHOT\library.jar" 
className="org.apache.catalina.webresources.JarResourceSet" 
webAppMount="/WEB-INF/classes" />
  <PostResources base="<absolutePath>\target\classes" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/classes" />
</Resources>
<Resources>
   <PostResources base="<absolutePath>\0.0.1-SNAPSHOT\library.jar" 
className="org.apache.catalina.webresources.JarResourceSet" 
webAppMount="/WEB-INF/classes" />
  <PostResources base="<absolutePath>\target\classes" 
className="org.apache.catalina.webresources.DirResourceSet" 
webAppMount="/WEB-INF/classes" />
</Resources>
(the last example is ok to not work according to the documentation (only 
jarResources are eligible for META-INF/resources scanning) )

So my question is that normal behavior of    <JarResources  or do I need more 
configuration to make it work using  
className="org.apache.catalina.webresources.JarResourceSet" ?

Thanks,
Fred

Reply via email to