Topic
1 reply Latest Post - ‏2009-11-19T22:42:47Z by Parthibban
SystemAdmin
SystemAdmin
6042 Posts
ACCEPTED ANSWER

Pinned topic Using ANT how to use EMF XSD2Java to generate Java classes from XML schema

‏2008-02-22T08:55:36Z |
Hello,
I am trying to automate generation of Java classes from XML Schema in the same way , RAD does where you can right click and say Generate Java.

I have posted my code here...I do not know what are the meanings of each attribute in the task and when I ran below script , RSA gets hanged or does nothing...
<path id="DomainModelproject.classpath.id">
<fileset dir="C:\Program Files\IBM\SDP70\configuration\org.eclipse.osgi\bundles\559\1\.cp\ant_tasks\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70\configuration\org.eclipse.osgi\bundles\1467\1\.cp\ant_tasks\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70\runtimes\base_v61\plugins\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70Shared\plugins\">
<include name="**/org.eclipse.xsd.ecore.importer_2.2.0.v200609210005.jar"/>
<include name="**/org.eclipse.emf.importer_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.codegen_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.common_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.converter_2.2.1.v200609210005.jar"/>

</fileset>
</path>
<taskdef name="RSAGenerateJava" classname="org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask">
<classpath refid="DomainModelproject.classpath.id"/>
</taskdef>
<target name="CreateJarDomainModelProject">
<RSAGenerateJava
model="c:/delete/addressType.xsd"
genModel="c:/delete/lib.genmodel"
>
<arg line="-packages http://www.example.eclipse.org/Library"/>
</RSAGenerateJava>
</target>
Updated on 2009-11-19T22:42:47Z at 2009-11-19T22:42:47Z by Parthibban
  • Parthibban
    Parthibban
    1 Post
    ACCEPTED ANSWER

    Re: Using ANT how to use EMF XSD2Java to generate Java classes from XML schema

    ‏2009-11-19T22:42:47Z  in response to SystemAdmin
    Hi Did you get this working. I am trying to do the same task and I am not getting the task to run.
    I am using the eclipse provided runtimes though not the jars from RAD.

    org.eclipse.emf.ant_2.2.0.v200705141058.jar
    org.eclipse.emf.importer.ecore_2.2.0.v200705141058.jar
    importer.ecore.tasks.jar
    org.eclipse.equinox.common_3.2.0.v20060603.jar
    emf.ant.tasks.jar

    Please let me know.

    Thanks
    Parthibban