I want to deploy a war file to a Wildfly 10 server and expose a class to the global class path. I want to be able to use this class within other war files.
Do you know if this is possible at deploytime?
Best Regards Alex
I want to deploy a war file to a Wildfly 10 server and expose a class to the global class path. I want to be able to use this class within other war files.
Do you know if this is possible at deploytime?
Best Regards Alex
Different war files in the
deployments
directory are separated by different class loaders. Hence, you cannot access from one war classes from another war.If you need "global" functionality that is accessible by all deployments, you can add a new module. Adjust and invoke the following command:
This will create a new folder under
$JBOSS_HOME\modules
with amodule.xml
file next to your jar. For more information about adding modules look for example here.Then add a dependency on this new module in your two war files, either by adding the module's name to the
Class-Path
entry in yourMANIFEST.MF
file or by supplying a dedicatedjboss-deployment-structure.xml
file (for more information see here).