-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: POM: Maven 1.0.2, Spring 1.2.1, and Hibernate 3.0.3 +XDoclet
PostPosted: Fri Jun 24, 2005 4:37 pm 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
Migrating from Spring 1.1.5, Hibernate 2.1.8, and XDoclet to Spring 1.2.1, Hibernate 3.0.3 and XDoclet.

Out configuration files (*.hbm.xml, spring.xml) are generated using XDoclet plugins under Maven.

Q: Does anyone have a functioning Maven POM (project.xml and associated project.properties) which is using similar versions?

Specifically I am experiencing a conflict between xdoclet-hibernate-module-1.2.3 and xdoclet-spring-module-1.2.3. With the hibernate plugin alone the hibernate mapping files are successfully generated. When 1.2.3 of spring module added, then no hibernate mappings are generated. Interestingly, if the hibernate-module 1.2.3 is used with the xdoclet-spring-module-1.2.1 then both generate output, however, the spring output is pre-1.2.1

Thanks


Top
 Profile  
 
 Post subject: Re: POM: Maven 1.0.2, Spring 1.2.1, and Hibernate 3.0.3 +XDo
PostPosted: Tue Jul 19, 2005 3:05 pm 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
Here is what works:

Code:
   <dependencies>


      <dependency>
         <groupId>hibernate</groupId>
         <artifactId>hibernate</artifactId>
         <version>3.0.5</version>
         <url>http://www.hibernate.org</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>

      <dependency>
         <groupId>springframework</groupId>
         <artifactId>spring</artifactId>
         <version>1.2.1</version>
         <url>http://www.springframework.org</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>

      <dependency>
         <groupId>springframework</groupId>
         <artifactId>spring-mock</artifactId>
         <version>1.2.1</version>
         <url>http://www.springframework.org</url>
      </dependency>
      
      <!-- BEGIN:Hibernate-Related Dependencies -->
      <dependency>
          <description>Needed for hib</description>
         <groupId>ehcache</groupId>
         <artifactId>ehcache</artifactId>
         <version>1.1</version>
         <url>http://ehcache.sourceforge.net</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Needed for hib</description>
         <groupId>cglib</groupId>
         <artifactId>cglib</artifactId>
         <version>2.1</version>
         <url>http://cglib.sourceforge.net</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Needed for hib</description>
         <groupId>antlr</groupId>
         <artifactId>antlr</artifactId>
         <version>2.7.5H3</version>
         <url>http://somewhere.antlr</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Needed for hib</description>
         <groupId>asm</groupId>
         <artifactId>asm</artifactId>
         <version>1.5.3</version>
         <url>http://objectweb.org</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Needed for hib</description>
         <groupId>asm</groupId>
         <artifactId>asm-attrs</artifactId>
         <version>1.5.3</version>
         <url>http://objectweb.org</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
        <dependency>
          <description>Needed for hib schema-export task</description>
         <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.4</version>
         <url>http://www.dom4j.org</url>
            <properties>
                <dist.bundle>true</dist.bundle>
            <war.bundle>true</war.bundle>
            </properties>
        </dependency>
      
      <!-- END:Hibernate-Related Dependencies -->
      <!-- BEGIN:Spring-Related Dependencies -->
      <dependency>
          <description>Needed for pool</description>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
         <version>3.1</version>
         <url>http://jakarta.apache.org/commons/collections</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
         <groupId>commons-dbcp</groupId>
         <artifactId>commons-dbcp</artifactId>
         <version>1.1</version>
         <url>http://jakarta.apache.org/commons/dbcp</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Used by web app</description>
         <groupId>commons-digester</groupId>
         <artifactId>commons-digester</artifactId>
         <version>1.5</version>
         <url>http://jakarta.apache.org/commons/digester</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
         <groupId>commons-pool</groupId>
         <artifactId>commons-pool</artifactId>
         <version>1.1</version>
         <url>http://jakarta.apache.org/commons/pool</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
   
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.0.4</version>
            <url>http://jakarta.apache.org/commons/logging/</url>
            <properties>
                <dist.bundle>true</dist.bundle>
            <war.bundle>true</war.bundle>
            </properties>
        </dependency>
      <dependency>
          <description>Used by code snippets</description>
         <groupId>commons-lang</groupId>
         <artifactId>commons-lang</artifactId>
         <version>2.0</version>
         <url>http://jakarta.apache.org/commons/lang</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
          <description>Needed for session factory support</description>
         <groupId>jta</groupId>
         <artifactId>jta</artifactId>
         <version>unknown</version>
         <url>http://java.sun.com/j2ee/transactions</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
         <groupId>hsqldb</groupId>
         <artifactId>hsqldb</artifactId>
         <version>1.7.2</version>
         <url>http://hsqldb.sourceforge.net</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      
      <!-- END:Spring-Related Dependencies -->
      

      <!-- Begin XDoclet Dependencies -->
      <dependency>
         <groupId>xdoclet</groupId>
         <artifactId>maven-xdoclet-plugin</artifactId>
         <version>1.2.3</version>
         <type>plugin</type>
         <url>http://xdoclet.sourceforge.net/xdoclet/maven-plugin.html</url>
      </dependency>
      <dependency>
         <groupId>gs-springframework</groupId>
         <artifactId>xdoclet-spring-module</artifactId>
         <version>1.2.1-WITH_ABSTRACT_DTD</version>
         <url>http://xdoclet.sourceforge.net/xdoclet/tags/spring-tags.html</url>
      </dependency>
      <dependency>
         <groupId>xdoclet</groupId>
         <artifactId>xdoclet-hibernate-module</artifactId>
         <version>1.2.3</version>
         <url>http://xdoclet.sourceforge.net/xdoclet/tags/hibernate-tags.html</url>
      </dependency>
      <dependency>
         <groupId>aopalliance</groupId>
         <artifactId>aopalliance</artifactId>
         <version>1.0</version>
         <url>http://aopalliance.sourceforge.net</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>


      <!--  Added upon initial migration -->
      <dependency>
         <groupId>struts</groupId>
         <artifactId>struts</artifactId>
         <version>1.1</version>
         <url>http://struts.apache.org</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      <dependency>
         <groupId>strutstestcase</groupId>
         <artifactId>strutstestcase</artifactId>
         <version>2.1.2-1.1-2.3</version>
         <url>http://strutstestcase.sourceforge.net</url>
      </dependency>
      
      <dependency>
         <groupId>servletapi</groupId>
         <artifactId>servletapi</artifactId>
         <version>2.3</version>
         <url>http://java.sun.com/products/servlet</url>
      </dependency>
      <dependency>
         <groupId>commons-beanutils</groupId>
         <artifactId>commons-beanutils</artifactId>
         <version>1.6.1</version>
         <url>http://jakarta.apache.org/commons/beanutils</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>
      
      <dependency>
         <groupId>oro</groupId>
         <artifactId>oro</artifactId>
         <version>2.0.8</version>
         <url>http://jakarta.apache.org/oro</url>
         <properties>
            <war.bundle>true</war.bundle>
         </properties>
      </dependency>

   </dependencies>




You may have noticed the odd 1.2.1-WITH_ABSTRACT_DTD dependency. This is because the DTD that shipped with the 1.2.1 xdoclet did not support the abstract attribute. If you do not require abstract spring proxies, you can probably just use the standard dtd.

Regards,

John


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2005 8:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Maybe this should be added to the wiki under the Xdoclet page so other might be able to reference it. Just a thought.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 3:47 pm 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
david wrote:
Maybe this should be added to the wiki under the Xdoclet page so other might be able to reference it. Just a thought.


David,

A good idea, unfortunately if you go to Xdoclet Wiki you'll see the following message:

Quote:
Due to excessive spamming, the wiki is currently offline.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 3:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
hibernate wiki, not the xdoclet one

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 27, 2005 10:43 am 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
emmanuel wrote:
hibernate wiki, not the xdoclet one


Ah, thanks for the clarification.


Top
 Profile  
 
 Post subject: Re: POM: Maven 1.0.2, Spring 1.2.1, and Hibernate 3.0.3 +XDo
PostPosted: Wed Jul 27, 2005 5:18 pm 
Newbie

Joined: Wed Jul 13, 2005 7:00 pm
Posts: 9
javapda wrote:
Here is what works:


Well.. actually my experience is that there are a lot of tweaks to do to get hibernate with maven and xdoclet. I'm using Maven 1.0.2 and Hibernate 3.0.5.

maven-hibernate-plugin last version is 1.3. This doesnot have support for 3.0. There is a diff file in their JIRA (http://jira.codehaus.org/browse/MPHIBERNATE-14) which can be applied and maven-hibernate-plugin. The patch supports 2.0 as well as 3.0 based on the package name it finds in the classpath. Somehow, this has not been released. Alteast, there is no info in the issue tracker whether this has been added to their present code base. If this patch is not used, maven tries to get net.sf.hibernate classes during schema-export..

Now, to the xdoclet. Again, xdoclet 1.2.3 does generate 3.0 mapping files, but there are some issues. One is with the unique. If you have unique attribute set for any of the properties, it generates the attribute twice. I'm not sure if this is fixed yet, but this was the problem when I got the xdoclet 1.2.3 i think about a week back. The solution for this is to use xdoclet 1.2.2 and xdoclet-hibernate-plugin from (http://opensource.atlassian.com/project ... e/XDT-1257). Note that this maynot support ALL the attributes of 3.0 but it works for me.

I have tested with these changes with maven. I think it should work ok with ant too. Also to generate the 3.0 mappings from hibernate, the following has to be set in maven.
maven.xdoclet.hibernatedoclet.hibernate.0.Version=3.0

There is a small price to pay for working with the cutting edge versions :)
I can update the wiki by tomorrow if you think its useful (it maynot be useful for long because I think these problems will be fixed by the xdoclet and maven-hibernate-plugin teams fast)

Also, others who have used Maven + Hibernate 3.0.5 + Xdoclet, please let me know if things can be done better.. (well because diff and path were never my forte.. )


Top
 Profile  
 
 Post subject: Re: POM: Maven 1.0.2, Spring 1.2.1, and Hibernate 3.0.3 +XDo
PostPosted: Thu Aug 04, 2005 6:26 pm 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
Thanks for the feedback.

The POM Dependencies, listed above, seems to get the job done for me.

That is with using Xdoclet, Hibernate 3.0.5 and Spring 1.2.1 under Maven 1.0.2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.