Search code examples
antjdeveloper

ANT job to invoke JDeveloper to create EAR file with specified deploy file


I was asked about the possibility of creating an ANT script that could be use to copy property files (associated to target environment), create an EAR file (perhaps using JDeveloper deploy file), and deploy that EAR file to target OC4J container.

I am asking if anyone ever successfully invoking JDeveloper automatically to create the EAR file by using specified 'deploy' file by using ANT? OR is it possible to by pass invoking JDeveloper at all. Is there any sample ANT code snippet to do so, or any information/hint that could be useful.

Thanks.


Solution

  • I would advise against using JDevelopers for creating an EAR file because I strongly believe that a build process must be autosufficient (i.e. as few external dependencies as possible).

    Using Ant, you can simply use the Ear task (remember that the Ear task is a subtask of the Zip task, i.e. you can also use zipfileset inside the ear task).

    I've never used OC4J but usually the deployment of an EAR file is just a matter of copying the file into the right directory (so a simple copy task would suffice).