[ 
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1616?page=comments#action_17507
 ] 

Chris Nappin commented on XDT-1616:
-----------------------------------

No wait, it's WAY more wierd than that.

The entire contents of the merge directory appears to be cached in memory in 
between invocations.

If I use the same directory for both invocations, deleting it's contents 
inbetween for good measure, the second invocation still merges the first merge 
file, even though it no longer exists on disk!

The "force" flag doesn't help, moving the mergeDir to the springxml rather than 
springdoclet makes no difference, and the "verbose" flag doesn't do anything at 
all.

Upgrading to Ant 1.6.5 makes no difference either.

My latest Ant code is as follows:

    <target name="springdoclet">
        <taskdef name="springdoclet" classpathref="ant.path"
         classname="xdoclet.modules.spring.SpringDocletTask"/>
        
        <!-- copy the application context merge files -->
        <copy file="${config}/application-beans.xml" 
         tofile="${build.springdoclet.temp}/spring-beans.xml"/>
        
        <!-- Generate the top level Spring application context -->
        <springdoclet destDir="${build.springdoclet}" verbose="true" 
force="true">
            <fileset dir="${admin.java}">
                <exclude 
name="com/abmuk/oms/admin/control/**/*Controller.java"/>
            </fileset>
            <springxml destinationFile="applicationContext.xml" 
             mergeDir="${build.springdoclet.temp}" validateXML="true"/>
        </springdoclet>
        
        <delete>
            <fileset dir="${build.springdoclet.temp}"/>
        </delete>
        
        <!-- copy the dispatcher merge files -->
        <copy file="${config}/dispatcher-beans.xml" 
         tofile="${build.springdoclet.temp}/spring-beans.xml"/>
        
        <!-- Generate the Spring dispatcher context -->
        <springdoclet destDir="${build.springdoclet}" verbose="true" 
force="true">
            <fileset dir="${admin.java}">
                <include 
name="com/abmuk/oms/admin/control/**/*Controller.java"/>
            </fileset>
            <springxml destinationFile="dispatcher-servlet.xml"
             mergeDir="${build.springdoclet.temp}" validateXML="true"/>
        </springdoclet>
    </target>

> If invoked twice springdoclet ignores destDir attribute
> -------------------------------------------------------
>
>          Key: XDT-1616
>          URL: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1616
>      Project: XDoclet
>         Type: Bug

>   Components: Spring Module
>     Versions: 1.2.3
>  Environment: Windows XP, JDK 1.4.2, Spring 1.2.5, Ant 1.6.1
>     Reporter: Chris Nappin
>     Assignee: xdoclet-devel (Use for new issues)

>
>
> If "springdoclet" is invoked twice, with different "destDir" attribute 
> values, then on the second invocation the attribute value is ignored and the 
> first one is used.
> For example:
>     <target name="springdoclet">
>         <taskdef name="springdoclet" classpathref="ant.path"
>          classname="xdoclet.modules.spring.SpringDocletTask"/>
>         
>         <!-- copy the application context merge files -->
>         <copy file="${config}/application-beans.xml" 
>          tofile="${build.springdoclet.application}/spring-beans.xml"/>
>         
>         <!-- Generate the top level Spring application context -->
>         <springdoclet destDir="${build.springdoclet.application}"
>             mergeDir="${build.springdoclet.application}">
>             <fileset dir="${admin.java}">
>                 <exclude 
> name="com/abmuk/oms/admin/control/**/*Controller.java"/>
>             </fileset>
>             <springxml destinationFile="applicationContext.xml" 
> validateXML="true"/>
>         </springdoclet>
>         
>         <!-- copy the dispatcher merge files -->
>         <copy file="${config}/dispatcher-beans.xml" 
>          tofile="${build.springdoclet.dispatcher}/spring-beans.xml"/>
>         
>         <!-- Generate the Spring dispatcher context -->
>         <springdoclet destDir="${build.springdoclet.dispatcher}" 
>          mergeDir="${build.springdoclet.dispatcher}">
>             <fileset dir="${admin.java}">
>                 <include 
> name="com/abmuk/oms/admin/control/**/*Controller.java"/>
>             </fileset>
>             <springxml destinationFile="dispatcher-servlet.xml" 
> validateXML="true"/>
>         </springdoclet>
>     </target>
> The file "dispatcher-servlet.xml" is created in the directory corresponding 
> to ${build.springdoclet.application}, not ${build.springdoclet.dispatcher} as 
> expected. If the first "springdoclet" call is commented out, then the file is 
> created in the expected directory.
> Note that specifying the destDir on the "springxml" task instead of the 
> "springdoclet" task causes an error (destDir is mandatory on springdoclet), 
> contrary to the XDoclet 1.2.3 documentation.

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



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to