I moved some class of teh quickstart in an EJB Module called <i>SecurityModule</i> and in a Jar library (for static things, identities and entities). Then I put this class as dependency of war and it still works.
I moved the same libraries in a EAR.
I had some problem with multiple dependency and i solved in this way:
In the pom.xml of EAR i have include Picketlink as dependency management
and in WAR pom.xml i put the dependency as provided:
The application starts but none of picketlink initializer are launched so the security system not works. See the three classes in the example