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.propertiesfile and set thetarget-plugin.nameproperty to the name of your project subdirectory (see SDK 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.nameproperty as needed to build and deploy other projects. -
If your project depends on any third-party
.jarfiles, place them into your project’slibdirectory.If the directory does not exist, create a new directory called
libdirectly under your project’s directory. For example,pingfederate/sdk/plugin-src/<subproject-name>/lib. -
On the command line in the
sdkdirectory, useantto clean, build, and package or to build, package, and deploy your project.Option Description Clean the project
ant clean-pluginCompile the project
ant compile-pluginCompile the project and create a
.jarfileant jar-pluginThe SDK creates a deployment descriptor in the
PF_INFdirectory and places it in a.jarfile. 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/classesdirectory. Thepf.plugins.<subproject-name>.jarfile is placed in thepingfederate/sdk/plugin-src/<subproject-name>/build/jardirectory.To compile the project, create a .
jarfile, and deploy the project to PingFederate, enter:ant deploy-plugin
This build target performs the steps described above and deploys any
.jarfiles found in thelibdirectory of your subproject.To deploy your plugin manually to an installation of the PingFederate server, copy the
.jarfile and any third-party.jarfiles into the/server/default/deploy/directory of that PingFederate installation. -
Restart the PingFederate server.