You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeff Mutonho <ej...@gmail.com> on 2007/06/04 12:18:59 UTC

xdoclet-maven-plugin generating incorrect hbm.xml file

I'm using the xdoclet-maven-plugin to generate my hibernate mapping
files and  I configured the plugin as follows :

<plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>xdoclet-maven-plugin</artifactId>
       <executions>
         <execution>
           <id>hbm-generation-with-xdoclet</id>
           <phase>generate-sources</phase>
           <configuration>
             <tasks>
             <hibernatedoclet destdir="src" force="false"
excludedtags="@version,@author,@todo">
               <fileset dir="src">
		  <include name="**/portal/**/*.java" />
		  <include name="**/reference/**/*.java" />
		  <include name="**/b2bassurance/**/*.java" />
		</fileset>
		<hibernate version="2.0"/>
	      </hibernatedoclet>
             </tasks>
             <generatedSourcesDirectory>target/classes</generatedSourcesDirectory>
           </configuration>
           <goals>
             <goal>xdoclet</goal>
           </goals>
         </execution>
       </executions>
     </plugin>


However the generated hbm.xml are incorrect and they do not match what
I get when I used Ant to generate the same hbm.xml files.Eg for one of
my classes Person .java

Maven generate this :
===============
<hibernate-mapping
>
    <class
        name="za.co.telkom.portal.Person"
        lazy="true"
    >

and

Ant generates this :

<hibernate-mapping>
    <class
        name="za.co.telkom.portal.Person"
        dynamic-update="false"
        dynamic-insert="false"
    >


The Ant one works at deployment time.The Ant task used is :

	<target name="eportal-domain-xdoclet" >
		<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">
			<classpath refid="portallib.classpath" />
		</taskdef>
		<hibernatedoclet verbose="false"
destdir="${ant.common.eportal.domain.dir}/src" force="false"
excludedtags="@version,@author,@todo">
			<fileset dir="${ant.common.eportal.domain.dir}/src">
				<include name="**/portal/**/*.java" />
				<include name="**/reference/**/*.java" />
				<include name="**/b2bassurance/**/*.java" />
			</fileset>
			<hibernate version="2.0" />
		</hibernatedoclet>
		<echo message="Regenerated Hibernate mapping files in
${basedir}\bin" level="info" />
	</target>


I'm using the same xdoclet-1.2.1.jar
,xdoclet-hibernate-module-1.2.1.jar and
xdoclet-xdoclet-module-1.2.1.jar both in  Ant and I've noticed that
Maven is using
xdoclet-hibernate-module-1.2.3.jar , which I suspect to be the src of
the inconsistency.How do I prevent Maven from using this
xdoclet-hibernate-module-1.2.3.jar?

Please help me , as I'm really stuck here.


-- 

"Don't take the name of root in vain."

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Jeff Mutonho <ej...@gmail.com>.
> I still find it hard to understand how  maven is denying me the
> flexibility of me saying I wish to use 1.2.1 jars instead of the new
> 1.2.3 xdoclet jars.
>
>

Seems the patience has finally paid off.All it took was just
configuring the plugin as follows :
<executions>
         <execution>
           <id>hbm-generation-with-xdoclet</id>
           <phase>generate-sources</phase>
           <configuration>
             <tasks>
             <hibernatedoclet destdir="src" force="true"
excludedtags="@version,@author,@todo">
               <fileset dir="src">
		  <include name="**/portal/**/*.java" />
		  <include name="**/reference/**/*.java" />
		  <include name="**/b2bassurance/**/*.java" />
		</fileset>
		<hibernate version="2.0"/>
	      </hibernatedoclet>
             </tasks>
             <generatedSourcesDirectory>target/classes</generatedSourcesDirectory>
           </configuration>
           <goals>
             <goal>xdoclet</goal>
           </goals>
         </execution>
       </executions>
       <dependencies>
        <dependency>
         <groupId>xdoclet</groupId>
         <artifactId>xdoclet-hibernate-module</artifactId>
         <version>1.2.1</version>
        </dependency>
       </dependencies>
-- 

"Don't take the name of root in vain."

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Jeff Mutonho <ej...@gmail.com>.
On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
>
> On 05/06/2007, at 12:08 AM, Jeff Mutonho wrote:
>
> > On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
> >> On 04/06/2007, at 10:48 PM, Jeff Mutonho wrote:>
> >> If so, does the mapping file have a DOCTYPE? The "lazy" attribute
> >> appears in the Hibernate 2.0 DTD, so it should be OK.
> >
> > Yes it does.It's like this :
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE hibernate-mapping PUBLIC
> >    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
> >    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
> >
> > <hibernate-mapping
> >>
> >    <class
> >        name="za.co.telkom.portal.Person"
> >        lazy="true"
> >    >
> >
>
> You have an XML parser error on line 58 according to your stack
> trace. That seems to be way after this. You've probably got some
> Hibernate 3.0 markup in your Person class and it has sneaked into the
> mapping file. Do you have a validating xml editor than you can check
> the mapping file with? If you can find the bad xml, you will be able
> to locate the associated bean markup and fix it, instead of
> continuing to hide it.
>
>
> >
> > The 1.2.1 version  looks like this :
> > <?xml version="1.0"?>
> >
> > <!DOCTYPE hibernate-mapping PUBLIC
> >    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
> >    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
> >
> > <hibernate-mapping>
> >    <class
> >        name="za.co.telkom.portal.Person"
> >        dynamic-update="false"
> >        dynamic-insert="false"
> >    >
> >
> > Isn't it possible to get Maven xdoclet plugin to use  work with the
> > 1.2.1 jars at runtime instead of the 1.2.3?
>
> Anything's possible, but it won't be easy. Fix the markup in your
> java classes instead.
>
> Steve Coy
>
>
Thanx Steve for your help.Its a bit tricky for me to sort out the java
classes instead due to redtape in convincing the powers that be why we
need to get rid of the lazy="true"  ...more so  due  the fact that  a
pre-existing build.xml file that uses the 1.2.1 jars does not have the
same issues the maven xdoclet plugin had

I still find it hard to understand how  maven is denying me the
flexibility of me saying I wish to use 1.2.1 jars instead of the new
1.2.3 xdoclet jars.


"Don't take the name of root in vain."

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Stephen Coy <st...@resolvesw.com>.
On 05/06/2007, at 12:08 AM, Jeff Mutonho wrote:

> On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
>> On 04/06/2007, at 10:48 PM, Jeff Mutonho wrote:>
>> If so, does the mapping file have a DOCTYPE? The "lazy" attribute
>> appears in the Hibernate 2.0 DTD, so it should be OK.
>
> Yes it does.It's like this :
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE hibernate-mapping PUBLIC
>    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
>    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
>
> <hibernate-mapping
>>
>    <class
>        name="za.co.telkom.portal.Person"
>        lazy="true"
>    >
>

You have an XML parser error on line 58 according to your stack  
trace. That seems to be way after this. You've probably got some  
Hibernate 3.0 markup in your Person class and it has sneaked into the  
mapping file. Do you have a validating xml editor than you can check  
the mapping file with? If you can find the bad xml, you will be able  
to locate the associated bean markup and fix it, instead of  
continuing to hide it.


>
> The 1.2.1 version  looks like this :
> <?xml version="1.0"?>
>
> <!DOCTYPE hibernate-mapping PUBLIC
>    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
>    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
>
> <hibernate-mapping>
>    <class
>        name="za.co.telkom.portal.Person"
>        dynamic-update="false"
>        dynamic-insert="false"
>    >
>
> Isn't it possible to get Maven xdoclet plugin to use  work with the
> 1.2.1 jars at runtime instead of the 1.2.3?

Anything's possible, but it won't be easy. Fix the markup in your  
java classes instead.

Steve Coy


> My attempt to alter/edit  the xdoclet-maven-plugin-1.0-alpha-1.pom
> backfired and I ended up with a corrupt repository.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Jeff Mutonho <ej...@gmail.com>.
On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
> On 04/06/2007, at 10:48 PM, Jeff Mutonho wrote:>
> If so, does the mapping file have a DOCTYPE? The "lazy" attribute
> appears in the Hibernate 2.0 DTD, so it should be OK.

Yes it does.It's like this :

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

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping
>
    <class
        name="za.co.telkom.portal.Person"
        lazy="true"
    >


The 1.2.1 version  looks like this :
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class
        name="za.co.telkom.portal.Person"
        dynamic-update="false"
        dynamic-insert="false"
    >

Isn't it possible to get Maven xdoclet plugin to use  work with the
1.2.1 jars at runtime instead of the 1.2.3?
My attempt to alter/edit  the xdoclet-maven-plugin-1.0-alpha-1.pom
backfired and I ended up with a corrupt repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Stephen Coy <st...@resolvesw.com>.
On 04/06/2007, at 10:48 PM, Jeff Mutonho wrote:

> On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
>> On 04/06/2007, at 9:43 PM, Jeff Mutonho wrote:
>>
>
>>
>> Anyway, I would not mind betting that your bean has been marked up
>> with something like:
>>
>> @hibernate.class
>>         lazy="true"
>>
>
> Correct.
>
>> Are you worried about the markup differences or something else?
> Well , when I deploy ear file , I get an  exception that relates to
> "lazy=true".The actual exception is
>
> Error creating bean with name
>  'mySessionFactory' defined in ServletContext resource
> [/WEB-INF/appcontext/databaseContext.xml]: Initialization of bean
> failed; nested
>  exception is net.sf.hibernate.MappingException: invalid mapping
>
> Caused by: org.xml.sax.SAXParseException: <Line 58, Column 25>:

Does this point at:

>    <class
>        name="za.co.telkom.portal.Person"
>        lazy="true"
>    >

?

If so, does the mapping file have a DOCTYPE? The "lazy" attribute  
appears in the Hibernate 2.0 DTD, so it should be OK.

The other alternative is to remove the markup from the java class/es  
because xdoclet 1.2.1 was ignoring it anyway.

Steve Coy

> XML-20137: (Error) Attribute 'lazy' used but not declared.
>    at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java: 
> 441)
>    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:303)
>    at oracle.xml.parser.v2.NonValidatingParser.parseDocument 
> (NonValidatingParser.java:290)
>    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
>    at org.dom4j.io.SAXReader.read(SAXReader.java:465)
>    at net.sf.hibernate.cfg.Configuration.addInputStream 
> (Configuration.java:283)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Jeff Mutonho <ej...@gmail.com>.
On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
> On 04/06/2007, at 9:43 PM, Jeff Mutonho wrote:
>

>
> Anyway, I would not mind betting that your bean has been marked up
> with something like:
>
> @hibernate.class
>         lazy="true"
>

Correct.

> Are you worried about the markup differences or something else?
Well , when I deploy ear file , I get an  exception that relates to
"lazy=true".The actual exception is

Error creating bean with name
  'mySessionFactory' defined in ServletContext resource
[/WEB-INF/appcontext/databaseContext.xml]: Initialization of bean
failed; nested
  exception is net.sf.hibernate.MappingException: invalid mapping

Caused by: org.xml.sax.SAXParseException: <Line 58, Column 25>:
XML-20137: (Error) Attribute 'lazy' used but not declared.
    at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:441)
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:303)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:290)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
    at org.dom4j.io.SAXReader.read(SAXReader.java:465)
    at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:283)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Stephen Coy <st...@resolvesw.com>.
On 04/06/2007, at 9:43 PM, Jeff Mutonho wrote:

> On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
>> Jeff,
>>
>>
>> Are you really still using Hibernate 2.0?
>>
>
> 100%.I've searched my repository and the only hibernate jar present is
> hibernate-2.0.0.jar

Sorry, that was kind of a rhetorical question.

Anyway, I would not mind betting that your bean has been marked up  
with something like:

@hibernate.class
	lazy="true"

because that is the only way that this

>> >    <class
>> >        name="za.co.telkom.portal.Person"
>> >        lazy="true"
>> >    >

would have been generated. xdoclet 1.2.1 does not support this  
attribute.

Also xdoclet 1.2.1 always generates

>> >        dynamic-update="false"
>> >        dynamic-insert="false"

xdoclet 1.2.3 only generates this markup if the corresponding java  
class has been marked up as well. Note that "false" is the default  
value and the fact that these values are missing from your maven  
build has the same meaning as far as Hibernate is concerned.

Are you worried about the markup differences or something else?

I just happen to have the source code for both versions of xdoclet on  
hand, and I know more or less how it works. So it's not too hard for  
me to explain any differences that you're experiencing.

Steve Coy

>
>
>
>> Cheers,
>>
>> Steve Coy
>>
>>
>> On 04/06/2007, at 8:18 PM, Jeff Mutonho wrote:
>>
>> > I'm using the xdoclet-maven-plugin to generate my hibernate mapping
>> > files and  I configured the plugin as follows :
>> >
>> > <plugin>
>> >       <groupId>org.codehaus.mojo</groupId>
>> >       <artifactId>xdoclet-maven-plugin</artifactId>
>> >       <executions>
>> >         <execution>
>> >           <id>hbm-generation-with-xdoclet</id>
>> >           <phase>generate-sources</phase>
>> >           <configuration>
>> >             <tasks>
>> >             <hibernatedoclet destdir="src" force="false"
>> > excludedtags="@version,@author,@todo">
>> >               <fileset dir="src">
>> >                 <include name="**/portal/**/*.java" />
>> >                 <include name="**/reference/**/*.java" />
>> >                 <include name="**/b2bassurance/**/*.java" />
>> >               </fileset>
>> >               <hibernate version="2.0"/>
>> >             </hibernatedoclet>
>> >             </tasks>
>> >             <generatedSourcesDirectory>target/classes</
>> > generatedSourcesDirectory>
>> >           </configuration>
>> >           <goals>
>> >             <goal>xdoclet</goal>
>> >           </goals>
>> >         </execution>
>> >       </executions>
>> >     </plugin>
>> >
>> >
>> > However the generated hbm.xml are incorrect and they do not  
>> match what
>> > I get when I used Ant to generate the same hbm.xml files.Eg for  
>> one of
>> > my classes Person .java
>> >
>> > Maven generate this :
>> > ===============
>> > <hibernate-mapping
>> >>
>> >    <class
>> >        name="za.co.telkom.portal.Person"
>> >        lazy="true"
>> >    >
>> >
>> > and
>> >
>> > Ant generates this :
>> >
>> > <hibernate-mapping>
>> >    <class
>> >        name="za.co.telkom.portal.Person"
>> >        dynamic-update="false"
>> >        dynamic-insert="false"
>> >    >
>> >
>> >
>> > The Ant one works at deployment time.The Ant task used is :
>> >
>> >       <target name="eportal-domain-xdoclet" >
>> >               <taskdef name="hibernatedoclet"
>> > classname="xdoclet.modules.hibernate.HibernateDocletTask">
>> >                       <classpath refid="portallib.classpath" />
>> >               </taskdef>
>> >               <hibernatedoclet verbose="false"
>> > destdir="${ant.common.eportal.domain.dir}/src" force="false"
>> > excludedtags="@version,@author,@todo">
>> >                       <fileset dir="$ 
>> {ant.common.eportal.domain.dir}/src">
>> >                               <include name="**/portal/**/ 
>> *.java" />
>> >                               <include name="**/reference/**/ 
>> *.java" />
>> >                               <include name="**/b2bassurance/**/ 
>> *.java" />
>> >                       </fileset>
>> >                       <hibernate version="2.0" />
>> >               </hibernatedoclet>
>> >               <echo message="Regenerated Hibernate mapping files in
>> > ${basedir}\bin" level="info" />
>> >       </target>
>> >
>> >
>> > I'm using the same xdoclet-1.2.1.jar
>> > ,xdoclet-hibernate-module-1.2.1.jar and
>> > xdoclet-xdoclet-module-1.2.1.jar both in  Ant and I've noticed that
>> > Maven is using
>> > xdoclet-hibernate-module-1.2.3.jar , which I suspect to be the  
>> src of
>> > the inconsistency.How do I prevent Maven from using this
>> > xdoclet-hibernate-module-1.2.3.jar?
>> >
>> > Please help me , as I'm really stuck here.
>> >
>> >
>> > --
>> >
>> > "Don't take the name of root in vain."
>> >
>> > Jeff  Mutonho
>> > Cape Town
>> > South Africa
>> >
>> > GoogleTalk : ejbengine
>> > Skype        : ejbengine
>> > Registered Linux user number 366042
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> -- 
>
> "Don't take the name of root in vain."
>
> Jeff  Mutonho
> Cape Town
> South Africa
>
> GoogleTalk : ejbengine
> Skype        : ejbengine
> Registered Linux user number 366042
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Jeff Mutonho <ej...@gmail.com>.
On 6/4/07, Stephen Coy <st...@resolvesw.com> wrote:
> Jeff,
>
>
> Are you really still using Hibernate 2.0?
>

100%.I've searched my repository and the only hibernate jar present is
hibernate-2.0.0.jar



> Cheers,
>
> Steve Coy
>
>
> On 04/06/2007, at 8:18 PM, Jeff Mutonho wrote:
>
> > I'm using the xdoclet-maven-plugin to generate my hibernate mapping
> > files and  I configured the plugin as follows :
> >
> > <plugin>
> >       <groupId>org.codehaus.mojo</groupId>
> >       <artifactId>xdoclet-maven-plugin</artifactId>
> >       <executions>
> >         <execution>
> >           <id>hbm-generation-with-xdoclet</id>
> >           <phase>generate-sources</phase>
> >           <configuration>
> >             <tasks>
> >             <hibernatedoclet destdir="src" force="false"
> > excludedtags="@version,@author,@todo">
> >               <fileset dir="src">
> >                 <include name="**/portal/**/*.java" />
> >                 <include name="**/reference/**/*.java" />
> >                 <include name="**/b2bassurance/**/*.java" />
> >               </fileset>
> >               <hibernate version="2.0"/>
> >             </hibernatedoclet>
> >             </tasks>
> >             <generatedSourcesDirectory>target/classes</
> > generatedSourcesDirectory>
> >           </configuration>
> >           <goals>
> >             <goal>xdoclet</goal>
> >           </goals>
> >         </execution>
> >       </executions>
> >     </plugin>
> >
> >
> > However the generated hbm.xml are incorrect and they do not match what
> > I get when I used Ant to generate the same hbm.xml files.Eg for one of
> > my classes Person .java
> >
> > Maven generate this :
> > ===============
> > <hibernate-mapping
> >>
> >    <class
> >        name="za.co.telkom.portal.Person"
> >        lazy="true"
> >    >
> >
> > and
> >
> > Ant generates this :
> >
> > <hibernate-mapping>
> >    <class
> >        name="za.co.telkom.portal.Person"
> >        dynamic-update="false"
> >        dynamic-insert="false"
> >    >
> >
> >
> > The Ant one works at deployment time.The Ant task used is :
> >
> >       <target name="eportal-domain-xdoclet" >
> >               <taskdef name="hibernatedoclet"
> > classname="xdoclet.modules.hibernate.HibernateDocletTask">
> >                       <classpath refid="portallib.classpath" />
> >               </taskdef>
> >               <hibernatedoclet verbose="false"
> > destdir="${ant.common.eportal.domain.dir}/src" force="false"
> > excludedtags="@version,@author,@todo">
> >                       <fileset dir="${ant.common.eportal.domain.dir}/src">
> >                               <include name="**/portal/**/*.java" />
> >                               <include name="**/reference/**/*.java" />
> >                               <include name="**/b2bassurance/**/*.java" />
> >                       </fileset>
> >                       <hibernate version="2.0" />
> >               </hibernatedoclet>
> >               <echo message="Regenerated Hibernate mapping files in
> > ${basedir}\bin" level="info" />
> >       </target>
> >
> >
> > I'm using the same xdoclet-1.2.1.jar
> > ,xdoclet-hibernate-module-1.2.1.jar and
> > xdoclet-xdoclet-module-1.2.1.jar both in  Ant and I've noticed that
> > Maven is using
> > xdoclet-hibernate-module-1.2.3.jar , which I suspect to be the src of
> > the inconsistency.How do I prevent Maven from using this
> > xdoclet-hibernate-module-1.2.3.jar?
> >
> > Please help me , as I'm really stuck here.
> >
> >
> > --
> >
> > "Don't take the name of root in vain."
> >
> > Jeff  Mutonho
> > Cape Town
> > South Africa
> >
> > GoogleTalk : ejbengine
> > Skype        : ejbengine
> > Registered Linux user number 366042
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 

"Don't take the name of root in vain."

Jeff  Mutonho
Cape Town
South Africa

GoogleTalk : ejbengine
Skype        : ejbengine
Registered Linux user number 366042

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: xdoclet-maven-plugin generating incorrect hbm.xml file

Posted by Stephen Coy <st...@resolvesw.com>.
Jeff,

This is really an xdoclet issue. The hibernate module in particular  
has dramatically increased functionality between xdoclet 1.2.1 and  
1.2.3. I would need to see the bean markup to be able to comment on  
why you are getting different results here.

I've used the maven xdoclet plugin extensively with Hibernate and  
have not had any problems of this kind.

Are you really still using Hibernate 2.0?


Cheers,

Steve Coy


On 04/06/2007, at 8:18 PM, Jeff Mutonho wrote:

> I'm using the xdoclet-maven-plugin to generate my hibernate mapping
> files and  I configured the plugin as follows :
>
> <plugin>
>       <groupId>org.codehaus.mojo</groupId>
>       <artifactId>xdoclet-maven-plugin</artifactId>
>       <executions>
>         <execution>
>           <id>hbm-generation-with-xdoclet</id>
>           <phase>generate-sources</phase>
>           <configuration>
>             <tasks>
>             <hibernatedoclet destdir="src" force="false"
> excludedtags="@version,@author,@todo">
>               <fileset dir="src">
> 		  <include name="**/portal/**/*.java" />
> 		  <include name="**/reference/**/*.java" />
> 		  <include name="**/b2bassurance/**/*.java" />
> 		</fileset>
> 		<hibernate version="2.0"/>
> 	      </hibernatedoclet>
>             </tasks>
>             <generatedSourcesDirectory>target/classes</ 
> generatedSourcesDirectory>
>           </configuration>
>           <goals>
>             <goal>xdoclet</goal>
>           </goals>
>         </execution>
>       </executions>
>     </plugin>
>
>
> However the generated hbm.xml are incorrect and they do not match what
> I get when I used Ant to generate the same hbm.xml files.Eg for one of
> my classes Person .java
>
> Maven generate this :
> ===============
> <hibernate-mapping
>>
>    <class
>        name="za.co.telkom.portal.Person"
>        lazy="true"
>    >
>
> and
>
> Ant generates this :
>
> <hibernate-mapping>
>    <class
>        name="za.co.telkom.portal.Person"
>        dynamic-update="false"
>        dynamic-insert="false"
>    >
>
>
> The Ant one works at deployment time.The Ant task used is :
>
> 	<target name="eportal-domain-xdoclet" >
> 		<taskdef name="hibernatedoclet"
> classname="xdoclet.modules.hibernate.HibernateDocletTask">
> 			<classpath refid="portallib.classpath" />
> 		</taskdef>
> 		<hibernatedoclet verbose="false"
> destdir="${ant.common.eportal.domain.dir}/src" force="false"
> excludedtags="@version,@author,@todo">
> 			<fileset dir="${ant.common.eportal.domain.dir}/src">
> 				<include name="**/portal/**/*.java" />
> 				<include name="**/reference/**/*.java" />
> 				<include name="**/b2bassurance/**/*.java" />
> 			</fileset>
> 			<hibernate version="2.0" />
> 		</hibernatedoclet>
> 		<echo message="Regenerated Hibernate mapping files in
> ${basedir}\bin" level="info" />
> 	</target>
>
>
> I'm using the same xdoclet-1.2.1.jar
> ,xdoclet-hibernate-module-1.2.1.jar and
> xdoclet-xdoclet-module-1.2.1.jar both in  Ant and I've noticed that
> Maven is using
> xdoclet-hibernate-module-1.2.3.jar , which I suspect to be the src of
> the inconsistency.How do I prevent Maven from using this
> xdoclet-hibernate-module-1.2.3.jar?
>
> Please help me , as I'm really stuck here.
>
>
> -- 
>
> "Don't take the name of root in vain."
>
> Jeff  Mutonho
> Cape Town
> South Africa
>
> GoogleTalk : ejbengine
> Skype        : ejbengine
> Registered Linux user number 366042
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org