What kind of jars are those? And where are they located?
I have a modular web app where the WAR itself only provides the core functionality, and is extensible by adding additional JARs with more CDI beans, JSF views, images, etc. The web app uses the ServiceLoader to detect the additional functionality.
I don't have any exact requirements for where the JARs should be located, but I would like not to have to open the WAR to place them inside the WEB-INF/lib directory. I tried to add a module where I could add the JARs to the module, and then have web app have the the module as an optional dependency. However, I couldn't get it to detect he JSF views inside the JARs through this approach.
The ideal solution would be to have a folder and have all JARs inside that folder put on the WARs class-path without having to modify the WAR. At first sight it seemed "<resource-root path="extensions" filter="*.jar"/>" could do it, but am I right in thinking that this will actually only place files from inside the WAR itself on the class-path?
I guess it boils down to one of:
- Is there a way to place JARs outside of the WAR on the class-path using "jboss-deployment-structure.xml"?
- Is there a way to get JSF views (and other resources) loaded from a module?
- Is there any other approach that could do this?
Same question here.
Is there any reason why you can't use an unpacked war and just copy files into the WEB-INF/lib directory?
Because I don't want to change the production artifact. So that it can be replaced on upgrades without affecting any customized code added by partners/customers.
Would sticking the war file inside of an exploded ear work? Then theoretically you should be able to stick the jars in the ear's lib directory.
I'm having the same issue. I had to create a link in the myapp.war/WEB-INF/lib to point at myapp.ear/lib. I really dont want to do that and I am using JBoss 7.1.1 Final. The jboss-deploymetn structure was in myapp.ear/META-INF but diesnt seem to have any effect. below is the deployment structure file. Shouldnt the ear/lib path be automatically in the classpath fro all sub-deployments?
<!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
<!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory -->
<resource-root path="wfm.jar" />
<module name="org.apache.log4j" export="true"/>
<exclusions> <!-- Vatsan -->
<!-- This corresponds to the module for a web deployment -->
<!-- it can use all the same tags as the <deployment> entry above -->
<!-- Adds a dependency on a ejb jar. This could also be done with a Class-Path entry -->
<!-- <module name="deployment.wfm.ear.wfm.jar" /> Vatsan -->