Introduction
This page will describe how the PicketLink libraries are organized in WildFly.
Before you start, you must know that WildFly is heavily based on JBoss Modules, which provides a modular class loading and execution environment. It allows you to centralize all the necessary dependencies and their configuration in a single place, making a lot more easier to manage your dependencies versions and deploy your applications.
The PicketLink libraries are shipped in WildFly since version 8.0.0.Final. So you don't need to ship any PicketLink library inside your deployment to get it running and using all features provided by PicketLink.
It is also important that you're familiar with WildFly Class Loading.
PicketLink Modules Organization
The PicketLink modules are all located at the following location:
[user@localhost picketlink]$ pwd
/home/user/wildfly-8.0.0.Final/modules/system/layers/base/org/picketlink
[user@localhost picketlink]$ ll
total 24
drwxrwxr-x. 3 user user 4096 Mar 14 14:23 common (PicketLink Commons)
drwxrwxr-x. 3 user user 4096 Mar 14 14:23 config (PicketLink Config)
drwxrwxr-x. 4 user user 4096 Mar 14 14:23 core (PicketLink Core API and Implementation)
drwxrwxr-x. 4 user user 4096 Mar 14 14:23 federation (PicketLink Federation and Bindings)
drwxrwxr-x. 5 user user 4096 Mar 14 14:23 idm (PicketLink IDM API and Implementation)
drwxrwxr-x. 2 user user 4096 Mar 14 14:23 main (PicketLink Federation for backward compatibility)
Each directory above is related with a specific PicketLink library. For example, core, federation and idm are related with PicketLink JEE Security, Federation and IDM, respectively. Inside each directory there is a main directory, where is located all JAR files. You will also notice a XML file called module.xml inside each directory, which is used to configure the module's resources and dependencies.
If you have ever used PicketLink in JBoss Application Server 7 or EAP, you'll notice that we still have the org.picketlink module (which maps to the org/picketlink/main directory). This module is there for backward compatibility, specially for those using PicketLink Federation. If you look at the module.xml you'll notice that there is no JAR reference, but a bunch of dependencies instead. The PicketLink Federation JARs are located at org.picketlink.federation and org.picketlink.federation.bindings modules.
The PicketLink Federation modules are NOT properly updated and configured in WildFly 8.0.0.Final. If you want to use it, you'll need to wait for WildFly 8.0.1+ versions.
You can get nightly builds of WildFly AS at https://community.jboss.org/thread/224262
The following table describes all modules and theirs corresponding JAR files.
Referencing PicketLink Modules from your Deployment
As mentioned before, you don't need to ship any PicketLink library with your deployment. You can always define the PicketLink dependencies using the jboss-deployment-structure.xml file as follows:
<jboss-deployment-structure>
<deployment>
<!-- You must configure the PicketLink dependency to your deployment. The dependency above is a reference to a static module
from WildFly modules directory. -->
<dependencies>
<module name="org.picketlink"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
In the example above, we're configuring the org.picketlink module as a dependency. As you can see, this is exactly the same configuration as you did before when using PicketLink Federation in JBoss AS7 or EAP.
The same is true for other PicketLink dependencies. If you want to enable PicketLink JEE Security to your deployment you need a configuration as follows:
<jboss-deployment-structure>
<deployment>
<!-- You must configure the PicketLink dependency to your deployment. The dependency above is a reference to a static module
from WildFly modules directory. -->
<dependencies>
<module name="org.picketlink.core"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
Updating PicketLink Modules
The version used by the modules is not always the latest version of PicketLink. The good news is that you can always update the PicketLink modules with the latest version by only replacing the JAR files for each module.
First of all, get the latest JAR version for the module you want to update. Check the table above for more details about each module and their corresponding JAR files.
Copy the JAR file to the main directory of the module and edit the module.xml as follows:
<module xmlns="urn:jboss:module:1.1" name="org.picketlink.common">
<resources>
<!-- Old version. -->
<!-- resource-root path="picketlink-common-2.6.0.Beta4.jar"/ -->
<!-- Change the resource-root to point to the JAR file you want to use. -->
<resource-root path="picketlink-common-NEW_VERSION.jar"/>
</resources>
<dependencies>
<!-- You don't need to change the dependencies !! -->
</dependencies>
</module>
When you update the modules with a specific PicketLink version make sure you get all modules updated. All modules must use the same version of PicketLink, otherwise you may get unexpected behaviors.