You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Darren Hartford <dh...@ghsinc.com> on 2003/02/18 20:50:16 UTC

xdoclet - through maven.xml only...

Please correct me if this is not the right approach...
As I understand, the xdoclet plugin isn't exactly up-to-snuff, and the best approach is to use the ant/xdoclet tags within maven.xml under each goal, which is perfect for my existing projects being migrated from Ant to Maven anyhow.

Now, the problem I am having is the ever-so-common "taskdef class xdoclet.modules.ejb.EjbDocletTask cannot be found" error.  I have gone through all the maven mailing list, Google, and my own trial-and-errors and have not been able to get anywhere.

I have removed ALL instances of xdoclet tags from my properties files, so the only place using xDoclet is maven.xml (assuming this is the correct approach) and the dependencies in project.xml. I have gotten my project to work with xdoclet using the plugins and property files, but is not suitable and need more fine-grain control available through the <goal> process.

Maven.xml
---------
<project xmlns:j="jelly:core"
    xmlns:maven="jelly:maven"
    xmlns:log="jelly:log"
    >

  <preGoal name="java:compile">
      <attainGoal name="gen-ejbs"/>
  </preGoal>

<goal name="gen-ejbs">
   <property name="myclasspath" refid="maven.dependency.classpath"/>
   <echo>classpath: ${myclasspath}</echo>
   <taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpath="${myclasspath}"/>
   <ejbdoclet
       destdir="${output.java.gen-src.dir}"
       ejbspec="2.0"
       verbose="true">
....stuff....
--------

I have tried many variations on the classpath, classpathref, nested classpath, and have not had success. Dependency is listed in the project.xml file, the xdoclet-ejb-module-1.2b2.jar is there in the place specified in classpath and have verified the xdoclet.modules.ejb.EjbDocletTask class exists. Forgive me for sounding frustrated, but so close and just trying to get over this one hill....

maven 1.0 beta 8
xdoclet 1.2b2

thanks for any help in advance!
-D

Re: xdoclet - through maven.xml only...

Posted by Colin Sampaleanu <co...@exis.com>.
Just add appropriate xdoclet jars to your project.xml, for exmple:
    <dependency>
      <id>xdoclet:xdoclet</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-bea-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-ejb-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet+jmx-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-mvcsoft-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-web-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-jboss-module</id>
      <version>1.2b3-dev</version>
    </dependency>
    <dependency>
      <id>xdoclet:xdoclet-xjavadoc</id>
      <version>1.2b3-dev</version>
    </dependency>

Then make sure in your taskdef for the ejbdoclet taks you are actually 
referencing these dependencies:
    <taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask">
      <classpath>
        <path refid="maven.dependency.classpath"/>
      </classpath>
    </taskdef>

Now I don't know what you have defined for ${myclasspath}, since you 
don't show the definition in your example,, but my guess is that one way 
or another, you don't have everything in there needed for ejbdoclet (and 
this is not just the ejbdoclet task jar, obviously xjavadoc is needed as 
well, and any subtasks. The method above is an easy way to get them in...

Colin


Darren Hartford wrote:

>Please correct me if this is not the right approach...
>As I understand, the xdoclet plugin isn't exactly up-to-snuff, and the best approach is to use the ant/xdoclet tags within maven.xml under each goal, which is perfect for my existing projects being migrated from Ant to Maven anyhow.
>
>Now, the problem I am having is the ever-so-common "taskdef class xdoclet.modules.ejb.EjbDocletTask cannot be found" error.  I have gone through all the maven mailing list, Google, and my own trial-and-errors and have not been able to get anywhere.
>
>I have removed ALL instances of xdoclet tags from my properties files, so the only place using xDoclet is maven.xml (assuming this is the correct approach) and the dependencies in project.xml. I have gotten my project to work with xdoclet using the plugins and property files, but is not suitable and need more fine-grain control available through the <goal> process.
>
>Maven.xml
>---------
><project xmlns:j="jelly:core"
>    xmlns:maven="jelly:maven"
>    xmlns:log="jelly:log"
>    >
>
>  <preGoal name="java:compile">
>      <attainGoal name="gen-ejbs"/>
>  </preGoal>
>
><goal name="gen-ejbs">
>   <property name="myclasspath" refid="maven.dependency.classpath"/>
>   <echo>classpath: ${myclasspath}</echo>
>   <taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpath="${myclasspath}"/>
>   <ejbdoclet
>       destdir="${output.java.gen-src.dir}"
>       ejbspec="2.0"
>       verbose="true">
>....stuff....
>--------
>
>I have tried many variations on the classpath, classpathref, nested classpath, and have not had success. Dependency is listed in the project.xml file, the xdoclet-ejb-module-1.2b2.jar is there in the place specified in classpath and have verified the xdoclet.modules.ejb.EjbDocletTask class exists. Forgive me for sounding frustrated, but so close and just trying to get over this one hill....
>
>maven 1.0 beta 8
>xdoclet 1.2b2
>
>thanks for any help in advance!
>-D
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-maven-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-maven-user-help@jakarta.apache.org
>
>  
>



Re: xdoclet - through maven.xml only...

Posted by Konstantin Priblouda <kp...@yahoo.com>.
I'm not maven guru , but xdoclet one. 

--- Darren Hartford <dh...@ghsinc.com> wrote:
> Please correct me if this is not the right
> approach...
> As I understand, the xdoclet plugin isn't exactly
> up-to-snuff, and the best approach is to use the
> ant/xdoclet tags within maven.xml under each goal,
> which is perfect for my existing projects being
> migrated from Ant to Maven anyhow.

I'm using this plugin off CVS version to generate 
views.properties for webwork. Works fine. 

What exactly you like to achieve?

> Now, the problem I am having is the ever-so-common
> "taskdef class xdoclet.modules.ejb.EjbDocletTask
> cannot be found" error.  I have gone through all the
> maven mailing list, Google, and my own
> trial-and-errors and have not been able to get
> anywhere.

I would also try to add xdoclet-xxx.jar & 
xdoclet-xjavadoc-xxx.jar to your classpath. 

Those are core classes of xdoclet and always needed
besides module jar files. 
( maven plugin takes care of them being on classpath 
automatically )


regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com