Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/DBWS/DBWSBuilder using ANT and javac"

Line 3: Line 3:
 
This example illustrates how DBWSBuilder can be invoked from ANT generating all of the required aretfacts to the file system and then compiling and packaging with additional ANT targets.
 
This example illustrates how DBWSBuilder can be invoked from ANT generating all of the required aretfacts to the file system and then compiling and packaging with additional ANT targets.
  
== dbws-builder.xml ==
+
=== build.properties ===
 +
<source lang="text">
 +
custom = true
 +
build.sysclasspath=ignore
 +
 
 +
stage.dir=${basedir}/stage
 +
jlib.dir=${basedir}/jlib
 +
server.platform=wls
 +
dbws.builder.file=dbws-builder.xml
 +
</source>
 +
 
 +
=== build.xml ===
 +
<source lang="xml">
 +
<?xml version="1.0"?>
 +
<project name="simpletable" default="build">
 +
  <property file="${basedir}/build.properties"/>
 +
 
 +
  <path id="build.path">
 +
    <fileset
 +
      dir="${jlib.dir}"
 +
      includes="eclipselink.jar
 +
                eclipselink-dbwsutils.jar
 +
                org.eclipse.persistence.oracleddlparser.jar
 +
                javax.wsdl.jar
 +
                javax.servlet.jar
 +
                ojdbc6.jar"
 +
      >
 +
    </fileset>
 +
  </path>
 +
 
 +
  <target name="build">
 +
    <java
 +
      classname="org.eclipse.persistence.tools.dbws.DBWSBuilder"
 +
      fork="true"
 +
      classpathRef="build.path"
 +
      >
 +
      <arg line="-builderFile ${dbws.builder.file} -stageDir ${stage.dir} -packageAs ${server.platform} ${ant.project.name}.war"/>
 +
    </java>
 +
  </target>
 +
</project>
 +
</source>
 +
 
 +
=== dbws-builder.xml ===
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Line 18: Line 60:
 
</dbws-builder>
 
</dbws-builder>
 
</source>
 
</source>
 +
  
 
[[Category:EclipseLink/Example/DBWS|ANT Builder]]
 
[[Category:EclipseLink/Example/DBWS|ANT Builder]]

Revision as of 14:07, 8 August 2012

DBWSBuilder using ANT

This example illustrates how DBWSBuilder can be invoked from ANT generating all of the required aretfacts to the file system and then compiling and packaging with additional ANT targets.

build.properties

custom = true
build.sysclasspath=ignore
 
stage.dir=${basedir}/stage
jlib.dir=${basedir}/jlib
server.platform=wls
dbws.builder.file=dbws-builder.xml

build.xml

<?xml version="1.0"?>
<project name="simpletable" default="build">
  <property file="${basedir}/build.properties"/>
 
  <path id="build.path">
    <fileset
      dir="${jlib.dir}"
      includes="eclipselink.jar 
                eclipselink-dbwsutils.jar 
                org.eclipse.persistence.oracleddlparser.jar 
                javax.wsdl.jar 
                javax.servlet.jar 
                ojdbc6.jar"
      >
    </fileset>
  </path>
 
  <target name="build">
    <java
      classname="org.eclipse.persistence.tools.dbws.DBWSBuilder"
      fork="true"
      classpathRef="build.path"
      >
      <arg line="-builderFile ${dbws.builder.file} -stageDir ${stage.dir} -packageAs ${server.platform} ${ant.project.name}.war"/>
    </java>
  </target>
</project>

dbws-builder.xml

<?xml version="1.0" encoding="UTF-8"?>
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <properties>
    <property name="projectName">simpletable</property>
    ... database properties
  </properties>
 
  <table
    schemaPattern="SCOTT"
    tableNamePattern="SIMPLETABLE"
  />
</dbws-builder>