[hibernate-issues] [Hibernate-JIRA] Created: (HBX-868) HibernateToolTask destdir not respected from chained ant

Michael Kintzer (JIRA) noreply at atlassian.com
Mon Feb 5 14:10:41 EST 2007


HibernateToolTask destdir not respected from chained ant
--------------------------------------------------------

         Key: HBX-868
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-868
     Project: Hibernate Tools
        Type: Bug

  Components: ant  
    Versions: 3.2beta9    
 Environment: Hibernate 3.2.1   HSQLDB 1.8.0-7.    
    Reporter: Michael Kintzer
 Attachments: destdir_bug.zip

Per the Hibernate Tools documentation:  The destdir attribute of the <hibernatetool> ant task is defined as:
destdir (required): destination directory for files generated with exporters.

Am using <hibernatetool> ant task to export ddl using hbm2ddl. This task is located in ./inner/build.xml.   Relative snippet of build.xml:
        <echo message="destdir attribute points to: ${data.dir}"/> 
        <hibernatetool destdir="${data.dir}">
            <classpath path="${build}"/>
            <configuration>
                <fileset dir="${src}">
                    <include name="**/*.hbm.xml"/>
                </fileset>
            </configuration>
            <hbm2ddl drop="false" create="true" export="true" update="false"/>
        </hibernatetool> 

Problem is that when ant build files are chained together, i.e. ./outer/build.xml calls ./inner/build.xml, the ddl output is written to a directory relative to ./outer, not ./inner as is specified by the "destdir" attribute in the ant task.

The evaluated value in ant for ${data.dir} when run in both cases is identical:
When run from ./inner/build.xml
[echo] destdir attribute points to: /home/michael/p4/private/mkintzer/hbtoolsbug/inner/data
When run from ./outer/build.xml
[echo] destdir attribute points to: /home/michael/p4/private/mkintzer/hbtoolsbug/inner/data

So according to the echo statements, ant in both cases has evaluated destdir to be the same absolute path, yet the output ends up in two different locations depending on where the build was run from. 



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list