The WildFly application server comes with a patching mechanism which makes it very easy to upgrade existing modules of the server or add new ones.
E.g. Hibernate Validator provides patch files which let you upgrade WildFly 10.1 to the preview releases of Bean Validation 2.0.
But you also can use the patching mechanism to add your own custom libraries to WildFly, making them available to deployed applications.
Even if you only ever deploy a single application to one WildFly instance, this can be very useful,
as it results in a smaller size of your deployment unit (WAR etc.) and thus faster build and deployment times.
How are WildFly patches created, though?
Patch files are generally just ZIP files which contain the module(s) to be added or updated as well as some additional metadata.
So in theory you could create them by hand, but there’s the patch-gen tool which greatly simplifies this task.
In the following we’ll describe step by step how to create a WildFly patch using the patch-gen-maven-plugin.
As an example, we’ll produce a patch file that adds the Eclipse Collections library to a WildFly instance.