Sunday, January 17, 2010

FAQ #10 - How to configure ojdeploy as an Ant target in JDeveloper 11g

Introduction

ojdeploy is a utility program that is installed along with JDeveloper 11g for the aid of building and deploying applications directly from the command line, without the need to actually start JDeveloper. In this FAQ we will see, how to invoke ojdeploy from within JDeveloper as an Ant target.

Main Theme

For a single workspace application, ojdeploy is configured and used automatically when creating a project buildfile. You can create a project buildfile by right-clicking on your project in the Application Navigator, selecting New.... and Buildfile from Project from the Ant category of the New Gallery dialog.


In the Create Buildfile from Project dialog, ensure that the Include Packaging Tasks (uses ojdeploy) option is selected. This option will invoke ojdeploy during the deployment of the application. Click OK to proceed with the creation of the buildfile.


Now take a look at the contents of the buildfile generated by JDeveloper - its name defaults to build.xml. An Ant target called deploy has been created that utilizes ojdeploy for the deployment of the application.


You invoke the deployment process by right-clicking on the buildfile and selecting the deploy target.


Now, for large applications where multiple application workspaces and projects are involved, ojdeploy is utilized in a different way, usually from a script file, where each individual application workspace deployment is invoked separately. For a couple of examples of utilizing ojdeploy in such cases, take a look at these blog entries:
In these cases, the deployment process runs outside JDeveloper by actually running a deployment script from the command line. The deployment script invokes ojdeploy with the -buildfile argument in order to specify an ojbuild file. Within the ojbuild file, each individual application project that is included in the deployment process is listed.

If you still want to invoke the deployment process - even in these cases - from within JDeveloper, simply select Empty Buildfile from the New Gallery dialog - under the Ant category - and add an Ant target to invoke your deployment script.


For example, the target ojdeploy shown below invokes the ${deployment.script} deployment script, which is defined in the build.properties Ant properties file.


Conclusion

For large-scale enterprise applications consisting of multiple workspace projects, the utilization of ojdeploy for automating the build and deployment processes becomes necessary. Although in these cases the deployment process runs from the command-line as a deployment script, you can configure an Ant target to run it from within the JDeveloper programming environment.

Until the next time, keep on JDeveloping!


References

Deploying ADF Applications
Building and Integrating Oracle ADF 11g Applications with OjDeploy Utility
ADF 11: Create Application EAR for test and production deployment respectively








No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...