While attending Steve Muench session on OOW'09 I learned about Oracle Fusion Applications Teams' Best Practices. One of the things I was very interested - ojdeploy utility usage in automatic builds. In our project, we are building and maintaining custom Ant scripts to generate EAR file and to deploy it to WLS. However, it creates a lot of extra work, especially while migrating from one Oracle ADF release to another. Some customers are considering to use Maven Integration in JDeveloper 11g R1 PS1 (see article) for integration builds. But, while designing your integration build architecture, you should not forget about powerful ojdeploy utility offered by Oracle and shipped together with JDeveloper 11g. From my point of view, main strengths of ojdeploy are the following:
- You can build deployment package directly from command line, same as it would be build using JDeveloper 11g wizards
- Oracle ADF library references are resolved automatically, this means you dont need to maintain complex Ant scripts
For today post I have decided to use application from my previous post - Integration in Oracle ADF with ADF Task Flows and Shared Java Classes. I have created ojdeploy script for this application, you can download complete sample - ADFIntegration5.zip. More info about ojdeploy utility you can find from Steve Muench blog post.
Sample application is based on 3 applications, one of them is main application. First are build two dependent applications and then EAR file is produced based on main application. In the script you need to point to appropriate deployment profiles to be invoked for each application:
Invoke ojdeploy utility from command line (ojdeploy -buildfile ojdeploy-build.xml) and all three applications will be compiled and packaged automatically:
EAR and WAR files are generated for main application, along with ADF Library JAR files for dependent applications:
In order to build and integrate my application, I have defined following deployment profiles:
ADF Library JAR deployment for first dependent application.
ADF Library JAR deployment for second dependent application.
WAR deployment profile for main application.
EAR deployment profile for main application.