Error in Generating code using Generator

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in Generating code using Generator

roy-2
Hi,

This is the first time I am using mybator. I have created a Eclipse
project with a "build.xml" and "generatorConfig.xml". I have referred
the "Running MyBatis Generator with ANT" guide to write "build.xml"
file and kept "generatorConfig.xml" at the same location of
"build.xml". Now when I run "build.xml", I get following error


Buildfile: C:\Roy\rnd\mybator\build.xml

genfiles:

BUILD FAILED
C:\Roy\rnd\mybator\build.xml:8: configfile generatorConfig.xml does
not exist

I tried to add path in "configfile" attribute but nothing worked. Can
anyone please let me know what I am missing.

<project default="genfiles" basedir=".">
     <property name="generated.source.dir" value="${basedir}" />

     <target name="genfiles" description="Generate the files">
       <taskdef name="mbgenerator"
                classname="org.mybatis.generator.ant.GeneratorAntTask"
                classpath="mybatis-generator-core-1.3.0.jar" />
       <mbgenerator overwrite="true" configfile="generatorConfig.xml"
verbose="true">
         <propertyset>
           <propertyref name="generated.source.dir"/>
         </propertyset>
       </mbgenerator>
     </target>
   </project>

Thanks for your help.

Rgds - Roy
Reply | Threaded
Open this post in threaded view
|

Re: Error in Generating code using Generator

roy-2
Thanks. I could sort it out by adding following

<eclipse.convertPath resourcepath="mybator/generatorConfig.xml"
        property="thePath" />
       <mbgenerator overwrite="true" configfile="${thePath}"
verbose="true">


Rgds - Roy

On Oct 19, 10:53 am, Roy <[hidden email]> wrote:

> Hi,
>
> This is the first time I am using mybator. I have created a Eclipse
> project with a "build.xml" and "generatorConfig.xml". I have referred
> the "Running MyBatis Generator with ANT" guide to write "build.xml"
> file and kept "generatorConfig.xml" at the same location of
> "build.xml". Now when I run "build.xml", I get following error
>
> Buildfile: C:\Roy\rnd\mybator\build.xml
>
> genfiles:
>
> BUILD FAILED
> C:\Roy\rnd\mybator\build.xml:8: configfile generatorConfig.xml does
> not exist
>
> I tried to add path in "configfile" attribute but nothing worked. Can
> anyone please let me know what I am missing.
>
> <project default="genfiles" basedir=".">
>      <property name="generated.source.dir" value="${basedir}" />
>
>      <target name="genfiles" description="Generate the files">
>        <taskdef name="mbgenerator"
>                 classname="org.mybatis.generator.ant.GeneratorAntTask"
>                 classpath="mybatis-generator-core-1.3.0.jar" />
>        <mbgenerator overwrite="true" configfile="generatorConfig.xml"
> verbose="true">
>          <propertyset>
>            <propertyref name="generated.source.dir"/>
>          </propertyset>
>        </mbgenerator>
>      </target>
>    </project>
>
> Thanks for your help.
>
> Rgds - Roy