Product SiteDocumentation Site

1.6. Maven Dependencies

PicketLink dependencies can be easily configured in your Maven-based project by using the PicketLink Bill of Materials(BOM). A BOM is a very handy tool to properly manage your dependencies and their versions keeping your project in sync with the libraries supported and distributed by a given PicketLink version.
For most applications using Java EE 6.0, the picketlink-javaee-6.0 BOM can be used to define the PicketLink and Java EE 6.0 dependencies to your project. However, if you are using Java EE 7.0 you can use picketlink-javaee-7.0 BOM. Despite the BOM artifact you choose, it will import to your project not only the PicketLink dependencies but also the ones related with the JEE version you are using.
<properties>
  <!-- PicketLink dependency versions -->
  <version.picketlink.javaee.bom>2.7.1.Final</version.picketlink.javaee.bom>
</properties>

<dependencyManagement>
  <dependencies>
    <!-- Dependency Management for PicketLink and Java EE 6.0. -->
    <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-javaee-6.0</artifactId>
      <version>${version.picketlink.javaee.bom}</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</dependencyManagement>
If you want to use Java EE 7.0 instead, just change the artifactId to picketlink-javaee-7.0 as follows:
<dependencyManagement>
  <dependencies>
    <!-- Dependency Management for PicketLink and Java EE 7.0. -->
    <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-javaee-7.0</artifactId>
      <version>${version.picketlink.javaee.bom}</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</dependencyManagement>
Once the BOM is properly configured, you need to configure the PicketLink dependencies. When using a BOM you don't need to specify their versions because this is managed automatically, the version in use depends on the BOM's version. For example, the configuration above is defining a version 2.7.1.Final of the picketlink-javaee-6.0 BOM, which means you'll be using version 2.7.1.Final of PicketLink libraries.
For a typical application, it is suggested that you include the following PicketLink dependency:
<dependencies>
    <!--
        PicketLink Uber Dependency. It provides all PicketLink dependencies from a single JAR. You still can define each module separately, if you want to.
    -->
  <dependency>
    <groupId>org.picketlink</groupId>
    <artifactId>picketlink</artifactId>
  </dependency>
</dependencies>
The org.picketlink:picketlink dependency above is a uber jar containing the most common PicketLink modules and their dependencies.
  • picketlink-api
  • picketlink-impl
  • picketlink-idm-api
  • picketlink-idm-impl
  • picketlink-deltaspike

Note

Take a look at the Modules section for more details about each dependency.
This is by far the most easy way to configure PicketLink in your project. The org.picketlink:picketlink dependency avoids you to specify each module separately.It enables to your project all Authentication, Authorization and Identity Management features provided by PicketLink.
However, you may not use the org.picketlink:picketlink dependency at all and define each module separately. The minimal dependencies required to enable PicketLink in your project are:
<dependencies>
<!-- Import the PicketLink API, we deploy this as library with the application,
        and can compile against it -->
  <dependency>
    <groupId>org.picketlink</groupId>
    <artifactId>picketlink-api</artifactId>
  </dependency>

<!-- Import the PicketLink Implementation, we deploy this as library with the application,
        but can't compile against it -->
  <dependency>
    <groupId>org.picketlink</groupId>
    <artifactId>picketlink-impl</artifactId>
    <scope>runtime</scope>
  </dependency>
	
</dependencies>
The dependencies above provide to your project all Authentication and Identity Management features provided by PicketLink.
If you also want to enable Authorization to your project, you can define the org.picketlink:picketlink-deltaspike dependency as follows:
<dependencies>
  <dependency>
    <groupId>org.picketlink</groupId>
    <artifactId>picketlink-deltaspike</artifactId>
  </dependency>
</dependencies>

Note

The authorization features provided by PicketLink are based on Apache DeltaSpike. When you configure the org.picketlink:picketlink-deltaspike dependency to your project, Deltaspike's dependencies are added to your project's classpath and shipped within your application.
If you want to configure the PicketLink Identity Management dependencies, then add the following to your project's pom.xml:
<dependencies>
  <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-idm-api</artifactId>
      <scope>compile</scope>
  </dependency>
  
  <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-idm-impl</artifactId>
      <scope>runtime</scope>
  </dependency>

Note

We strongly recommend using a BOM to configure your project with the PicketLink dependencies. This can avoid some very common and tricky issues like keep the dependencies in sync with the versions distributed in a release.