From Glassfish to Wildfly - Shared lib dir - part 3

Shared lib dir in Wildfly

In glassifsh I was using a domains/domain1/lib/ directory as shared directory where to put all jars needed by all applications (ear, war, jar)

When install wildfly sure you will search for similiar directory..
Nope..
Wildfly hasn't a shared lib directory, but are using a module concept and other classloading system.

You can install module, global module or follow the next solution.

I make different EAR which group some jars.
For example PdfBoxLibEar where I put pdfbox jar, itext jar, xmlworker jar.

When making the ear be sure that the jar embedded is deployed in lib/ directory of ear.

Then When an application foo needs to PdfBoxLibEar write in manifest.mf the following:

Manifest-Version: 1.0
Dependencies: deployment. LIB_PdfBoxLibEar.ear export, deployment. OTHER_LIB.ear export,

deployment is location where ear is deployed by default.
export is a keyword for make the library available also with internal ear modules(i.e. war or ejb)

No comments: