Building and deploying with Ant
Use the Apache Ant build script to clean, build, package, and deploy projects within the PingFederate Java SDK.
About this task
The PingFederate Java SDK comes with an Apache Ant build script that simplifies building and deploying your projects.
Steps
-
Edit the
build.local.properties
file and set thetarget-plugin.name
property to the name of your project subdirectory (see Directory structure).You can develop source code for multiple projects simultaneously, but you can build and deploy only one at a time. Change the value of the
target-plugin.name
property as needed to build and deploy other projects. -
If your project depends on any third-party
.jar
files, place them into your project’slib
directory.If the directory does not exist, create a new directory called
lib
directly under your project’s directory. For example,pingfederate/sdk/plugin-src/<subproject-name>/lib
. -
On the command line in the
sdk
directory, useant
to clean, build, and package or to build, package, and deploy your project.Option Description Clean the project
ant clean-plugin
Compile the project
ant compile-plugin
Compile the project and create a
.jar
fileant jar-plugin
The SDK creates a deployment descriptor in the
PF_INF
directory and places it in a.jar
file. The descriptor tells PingFederate what plugin implementations are contained in the file, and the compiled class files and the deployment descriptor are placed in thepingfederate/sdk/plugin-src/<subproject-name>/build/classes
directory. Thepf.plugins.<subproject-name>.jar
file is placed in thepingfederate/sdk/plugin-src/<subproject-name>/build/jar
directory.To compile the project, create a .
jar
file, and deploy the project to PingFederate, enter:ant deploy-plugin
This build target performs the steps described above and deploys any
.jar
files found in thelib
directory of your subproject.To deploy your plugin manually to an installation of the PingFederate server, copy the
.jar
file and any third-party.jar
files into the/server/default/deploy/
directory of that PingFederate installation. -
Restart the PingFederate server.