Tuesday, May 17, 2011

OJDeploy revisited libraries not included in compile via ant

My ojdeploy build was crashing when running via ant.
The difference between the command line build which was working and the ant build was a relative (../) location in the name of the workspace.

C:/Projects/Common/Model/../Common.jws instead of C:/Projects/Common/Common.jws

So the fix was as follows:
Add a new property with the location attribute:


And use this in my ant task:


  <taskdef name="ojdeploy"
    classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask"
    uri="oraclelib:OJDeployAntTask"
    classpath="${ant.library}"/>
    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask" 
    executable="${ojdeploy.path}"
    ora:statuslog="${basedir}/${ora.jdev.dir}${project.deploy.name}-ojd-stlog.xml"
    ora:buildscript="${basedir}/${oracle.jdev.dir}/ojd-build.xml">
      <ora:deploy>
        <ora:parameter name="workspace"
                       value="${workspace.fixed.location}"/>
        <ora:parameter name="project" value="${project.name}"/>
        <ora:parameter name="profile" value="${project.name}Deploy"/>
        <ora:parameter name="nodatasources" value="true"/>
        <ora:parameter name="forcerewrite" value="true"/>
    <ora:parameter name="basedir" value="${basedir}"/>
  </ora:deploy>
</ora:ojdeploy>

No comments:

Post a Comment