Hi,
I want XDoclet to parse java source files which are placed in a jar file.
(I use XDoclet 1.2.2 with ANT 1.6.1.)
We have got a very large project with about 150 session beans and want to generate the interfaces and deploymentdescriptors for them. Of course we have a type hierarchy between the session beans.
E.g. the sub-class SubEJB extends the super-class SuperEJB. The two classes have different packages. The developer only gets the SubEJB from the version control system and wants to generate the artifacts. The super-class SuperEJB exists as a class file in a jar. But XDoclet needs the java source of the SuperEJB. Pro jar file we have got a second archiv (also a jar) which contains the java sources.
How XDoclet can use these jars with the source files?
Up to now I unjar the jars with the java sources in a speperate path src/xdoclet before I call ejbdoclet.
Here the build.xml:
<!-- ******************************************************************* -->
<!-- target to unpack the java sources -->
<!-- ******************************************************************* -->
<target name="prepare-xdoclet" depends="prepare">
<unjar dest="${src-xdoclet}" overwrite="false">
<fileset dir="${bstsrcdir}">
<include name="*.jar"/>
</fileset>
<patternset>
<include name="**/*.java"/>
</patternset>
</unjar>
</target>
<!-- ******************************************************************* -->
<!-- task definition for the <ejbdoclet> task -->
<!-- ******************************************************************* -->
<target name="ejbdoclet" >
<taskdef name="ejbdoclet"
classname="xdoclet.modules.ejb.EjbDocletTask"
classpathref="xdoclet.lib.path" />
</target>
<!-- ******************************************************************* -->
<!-- this target will be called from other build files to generate
ejb artifacts for the given package -->
<!-- ******************************************************************* -->
<target name="sub-generate-ejb" depends="prepare-xdoclet,ejbdoclet" >
<ejbdoclet destdir="${gen}"
excludedtags="@version,@author,@todo"
addedtags="@xdoclet-generated ${TSTAMP}"
ejbSpec="1.1">
<fileset dir="${src}" includes="${genpackagename}/*EJBBean.java"/>
<fileset dir="${src-xdoclet}" excludes="**/*.java"/>
<deploymentdescriptor destdir="${gen}/${genpackagename}/META-INF"/>
<homeinterface/>
<remoteinterface/>
</ejbdoclet>
</target>
It works but is very slow and complicate.
Please ask me for more information if needed.
Thanks for your answers,
Gunnar Krüger