Few days ago I have described how to extract ADF shared libraries from main EAR deployment package into separate WAR library deployment - Deploying ADF Applications as Shared Libraries on WLS. Now its time to tell you, how to redeploy and version ADF shared libraries on WLS. Next blog post will be focused on main site production redeployment. Today I'm describing ADF shared library versioning concepts and why it could be useful in your environment.
Download sample application with ADF shared libraries deployment and versioning scripts - ADFIntegrationUIShell5.zip. This application is based on developed sample from previous blog post mentioned above.
Let's assume we have our application running on the server, functionality is tested and works well:
There are already two versions of our ADF shared library deployed. Because main site doesn't specify, which version of shared library to use, the latest one will be always used automatically. In this case, it is redsamurai.shared.lib 1.0.1 version:
Now we deploy redsamurai.shared.lib update, version 1.0.2. Developer left one bug in this latest version, test team didn't performed test properly - Save button functionality is broken:
We check deployed shared library versions, you can see 1.0.2 version available - its where new bug was introduced:
However, we saw that Save button was working properly with previous redsamurai.shared.lib release - 1.0.1. This means, we simply can revert back to 1.0.1 shared library version - while development will fix Save button bug. In order to revert to the previous library version, first we need to stop main site deployment, shared library consuming application - UIShell:
When main application is stopped, delete redsamurai.shared.lib 1.0.2 library:
You can start now main application, it will automatically consume latest available shared library version - redsamurai.shared.lib 1.0.1:
Previously broken functionality is fixed - Save button is working well:
Now I will describe how you can increase shared library version and deploy it to WLS server. Developer have updated Departments fragment functionality, by adding new button - Undo:
Because we are using shared library deployment, there is no need to redeploy main site. First, we rebuild ADF library for Departments:
Then we need to increase redsamurai.shared.lib version:
Package all ADF libraries into redsamurai.shared.lib WAR deployment package - use create-shared-lib Ant target:
Shared library WAR archive should be generated now:
Verify generated library version, you can find it in MANIFEST file. This file is inside WAR archive package, it should be latest version - 1.0.2:
Deploy redsamurai.shared.lib to WLS using deploy-shared-lib Ant target. This Ant target is using two wldeploy commands - first it redeploys our shared library with new version and then it reloads main site. We need to reload main site in order to use latest available shared library. Otherwise we would need to restart WLS server in order to pick up latest redamurai.shared.lib library updates:
You can verify library deployments screen, latest shared library should be available:
UIShell application brings latest update in Departments fragment - Undo button:
If latest deployed shared library version is stable, you can remove previous versions from WLS. However, it is good practice to leave at least base version always available on WLS.