[ http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1616?page=comments#action_17677 ]
Zarar Siddiqi commented on XDT-1616: ------------------------------------ I'm not advocating doing this but there is another workaround. Just re-initialize the springdoclet taskdef before you call it the second time and it will work. To make life neater/easier, use a macro: <macrodef name="springdocletmacro"> <attribute name="destDir"/> <attribute name="mergeDir"/> <attribute name="srcDir"/> <attribute name="destFile"/> <sequential> <taskdef name="springdoclet" classname="xdoclet.modules.spring.SpringDocletTask" classpathref="xdoclet.classpath" > </taskdef> <springdoclet destDir="@{destDir}" mergeDir="@{mergeDir}"> <fileset dir="@{srcDir}"/> <springxml destinationFile="@{destFile}" validateXML="true"/> </springdoclet> </sequential> </macrodef> and then call it like this: <springdocletmacro srcDir="${src.dir}" mergeDir="${merge.dir}" destDir="${output.dir}" destFile="applicationContext.xml"/> I think this is a little better than having multiple ant tasks. > 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 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel