On Wed, 2005-02-02 at 05:04, Rob Griffin wrote:
> Hello,
>
> I'm trying to use XDoclet to generate JMX interfaces and descriptors.
>
> I have a simple HelloWorld class with this Javadoc
>
> package com.quest.jmxxx;
> /**
> *
> * @jmx.mbean
> * name="HelloWorld"
> * persistPolicy="NoMoreOftenThan"
> * persistPeriod="3000"
> *
> **/
> public class HelloWorld
> {
> ...etc..
> }
>
> and my Ant file looks like this:
>
> <target name='GenerateJMXFiles' depends='init'>
> <jmxdoclet destDir ='${source.dir}/com/quest/jmxxx'
> force ='true'
> verbose ='true'>
> <fileset dir='${source.dir}/com/quest/jmxxx'/>
That tells XDoclet (or, more precisely, the parser it uses) that the
root of your package hierarchy is ${source.dir}/com/quest/jmxxx. When
it then finds that the package of your classes doesn't match their
location *below that directory*, it skips the files. Just use
<fileset dir='${source.dir}' includes="**/*.java"/>
instead and it should be fine.
Also, you should probably change that destDir parameter too, otherwise
you'll find it generates the files in
${source.dir}/com/quest/jmxxx/com/quest/jmxxx
Again, just use destDir='${source.dir}' and XDoclet will put things in
the right packages below that.
However, in general you should generate things into a separate location
to the original source files (and then include both sets of files in the
sourcepath when you compile). Otherwise, a poorly configured subtask or
parameter in the @tags could potentially cause XDoclet to overwrite the
files you've spent so long writing...
Andrew.
> <mbeaninterface/>
> </jmxdoclet>
>
> </target>
>
> When I run Ant the jmxdoclet task runs but no files are generated. I get
> this output
>
> GenerateJMXFiles:
> [jmxdoclet] 2/02/2005 15:56:05 xdoclet.XDocletMain start
> [jmxdoclet] INFO: Running <mbeaninterface/>
>
> Thanks,
>
> Rob Griffin
--
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user