I've been trying to use xdoclet’s “template” subtask to generate proxy classes based on some of my java classes.


What I have found is that a Java file with no "package" statement gets transformed just fine. But if a Java file has a package statement (as 99% of them do!), then it is ignored by the template subtask.

 

The java files are in a "src_core" directory that is in the same directory as the build.xml. So one file path might be src_core/com/mycompany/foo/bar/HiMom.java, and its package is com.mycompany.foo.bar. As an experiment, I tried changing the Java file's package line, and no change made it work, other than removing the package line entirely.

It occurred to me that perhaps I needed to add the "src_core" directory to some internal classpath somewhere, but didn't see any way to do that.

 

Can anyone explain what’s going on, and what the fix would be?

 

 

Here’s the build.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<project name="test" basedir="." default="help">

 

    <property name="lib.dir" location="${basedir}/lib"/>

    <property name="xdoclet.lib.dir" location="${basedir}/lib"/>

 

    <target name="generateproxy">

            <path id="xdoclet.lib.path"> <fileset dir="/xdoclet-1.2.2" includes="*.jar"/> </path>

 

            <taskdef name="xdoclet" classname="xdoclet.DocletTask" classpathref="xdoclet.lib.path" />

 

            <xdoclet destDir="/tmp" force="true">

                        <fileset dir="${basedir}/src_core/com/nimblefish/core/domain/campaign">

                                    <include name="*.java"/>

                        </fileset>

                        <template templateFile="${basedir}/proxy.xdt" destdir="${basedir}"

                                    destinationFile="{0}Proxy.java" />

            </xdoclet>

    </target>

</project>

 

Reply via email to