Using Ant To Deploy EAR To OC4J
I just learn how to use Ant build to deploy ejb application into OC4J Version 11.1.1.0 in Eclipse IDE. First need to add the ant-oracle.jar and ant-oracle-classes.jar file into Eclipse Ant. Follow steps listed below to complete the configuration.
- Select Windows->Preferences->Ant-Runtime->Classpath->Ant Home Entries.
- Click on the Add External Jar button.
- The ant-oracle.jar was located at $ORACLE_HOME\ant\lib
- The ant-oracle-classes.jar was located at $ORACLE_HOME\j2ee\ant-tasks\ant-oracle-classes.jar
Add the following target into your build file.
<target name="deploy-oc4j" depends="undeploy-oc4j">
<oracle:deploy deployerUri="${deployer.uri}"
userid="${oc4j.admin.user}" password="${oc4j.admin.password}"
file="${dist.dir}/${ear.jar.name}"
deploymentname="${app.name}"
logfile="${deploy.log.dir}/deploy-ear.log"
bindAllWebApps="default-web-site"/>
</target>
Explanation
deployer.uri = deployer:oc4j:localhost:23791
You can change the localhost to the oc4j server you want to deploy and the port 23791 is the default port, you can change according to your setting.
Comments