Hi,

I am at my wits end in getting maven to play nicely with Hibernate.  I've
been at it for over a week now and feel no closer than when I started.
Here's what I'm trying to do.  I've been working on a project using Maven
2.0.4 as the build system.  Everything has been going fine until I try and
get Maven to generate the Hibernate DDL and java from my hbm files.  I've
tried using the codehaus hibernate3-maven-plugin with no success.  I later
discovered that when they had their crash, it took out lots of the plugin
files.  I've tried to just integrate the hibernate portions into the POM as
a simple Ant task.  I can't even get Maven to recognize the Ant tasks.  I've
RTFM (as much as there is one).  I've tried all the available code snippets
I can find.  So far, nothing has worked.  here is my POM file, slightly
edited to protect the guilty.

With the config files below, I don't even get the echos.

If anyone has a sample section from the POM file for doing Hibernate 3
stuff, I would greatly appreciate a code-snippet.

Thanks.

/Paul

<?xml version="1.0" encoding="UTF-8"?><project>
 <modelVersion>4.0.0</modelVersion>

 <!-- POM Relationships -->
 <groupId>com.mycompany.simulators</groupId>
 <artifactId>caisim</artifactId>
 <version>1.0-SNAPSHOT</version>
<!--
 <parent>
   <groupId>com.mycompany.simulators</groupId>
   <artifactId>simulators</artifactId>
   <version>1.0.0</version>
 </parent>
-->
 <dependencyManagement>
 </dependencyManagement>

 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
   </dependency>
   <dependency>
     <groupId>commons-logging</groupId>
     <artifactId>commons-logging</artifactId>
     <version>1.0.4</version>
   </dependency>
   <dependency>
     <groupId>commons-configuration</groupId>
     <artifactId>commons-configuration</artifactId>
     <version>1.2</version>
   </dependency>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate</artifactId>
     <version>3.2.0.cr2</version>
   </dependency>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate-annotations</artifactId>
     <version>3.2.0.cr1</version>
   </dependency>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate-tools</artifactId>
     <version>3.1.0.beta4</version>
   </dependency>
 </dependencies>

 <modules>
 </modules>

 <!-- Project Information -->
 <name>My Simulator</name>
 <description>My interface simulator.</description>
 <url>http://www.mycompany.com</url>
 <inceptionYear>2006</inceptionYear>
 <licenses></licenses>
 <developers>
   <developer>
     <id>myname</id>
     <name>My Name</name>
     <email>[EMAIL PROTECTED]</email>
     <organization></organization>
     <roles>
       <role>Developer</role>
     </roles>
     <timezone>-6</timezone>
   </developer>
 </developers>
 <contributors>
 </contributors>
 <organization>
   <name>mycompany, Inc.</name>
   <url>http://www.mycompany.com</url>
 </organization>

 <!-- Build Settings -->
 <packaging>jar</packaging>
 <properties></properties>
 <build>
   <finalName>csf</finalName>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
             <source>1.5</source>
             <target>1.5</target>
           </configuration>
         </plugin>

         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-antrun-plugin</artifactId>
           <executions>
             <execution>
               <phase>generate-sources</phase>
               <configuration>
                 <tasks>
                   <echo>Running Hibernate stuff here.</echo>
                   <ant antfile="${basedir}/build-hibernate.xml"
inheritRefs="true">
                     <target name="hibernate"/>
                   </ant>
                 </tasks>
               </configuration>
               <goals>
                 <goal>run</goal>
               </goals>
             </execution>
           </executions>
           <dependencies>
           </dependencies>
         </plugin>
       </plugins>
     </pluginManagement>

   <extensions>
   </extensions>

   </build>

 <reporting>
   <plugins>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-javadoc-plugin</artifactId>
       <reportSets>
<!--
         <reportSet>
           <id>uml</id>
           <configuration>
             <doclet>gr.spinellis.umlgraph.doclet.UmlGraph</doclet>
             <docletArtifact>
               <groupId>umlgraph</groupId>
               <artifactId>UmlGraph</artifactId>
               <version>4.3</version>
             </docletArtifact>
             <additionalparam>-views</additionalparam>
             <destDir>target/uml</destDir>
             <show>private</show>
           </configuration>
           <reports>
             <report>javadoc</report>
           </reports>
         </reportSet>
-->
         <reportSet>
           <id>html</id>
           <configuration>
             <show>private</show>
           </configuration>
           <reports>
             <report>javadoc</report>
           </reports>
         </reportSet>
       </reportSets>
     </plugin>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-checkstyle-plugin</artifactId>
       <configuration>
         <configLocation>src/main/config/mycompany-checkstyle.xml
</configLocation>
       </configuration>
     </plugin>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jxr-plugin</artifactId>
     </plugin>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-pmd-plugin</artifactId>
                   <configuration>
           <targetJdk>1.5</targetJdk>
           <format>xml</format>
           <linkXref>true</linkXref>
           <sourceEncoding>utf-8</sourceEncoding>

           <minimumTokens>100</minimumTokens>
        </configuration>
     </plugin>
   </plugins>
 </reporting>

 <!-- Build Environment -->
 <!-- Envitonment Information -->
 <issueManagement>
   <system>Our Crappy Bug System</system>
   <url>http://jigsaw.mycompany.com/main</url>
 </issueManagement>
 <ciManagement></ciManagement>
 <mailingLists></mailingLists>
 <scm>
   <connection>scm:cvs:pserver:anoncvs:@gollum.mycompany.com
:/lib/cvs:simulators/mysim</connection>
   <url>http://gollum.mycompany.com/cgi-bin/viewcvs.cgi/simulators/mysim
</url>
 </scm>

 <!-- Maven Environment -->
 <prerequisites></prerequisites>

<repositories>
 <repository>
   <id>Maven Snapshots</id>
   <url>http://snapshots.maven.codehaus.org/maven2/</url>
   <snapshots>
     <enabled>true</enabled>
   </snapshots>
   <releases>
     <enabled>false</enabled>
   </releases>
 </repository>
</repositories>
<pluginRepositories>
 <pluginRepository>
   <id>Maven Snapshots</id>
   <url>http://snapshots.maven.codehaus.org/maven2/</url>
   <snapshots>
     <enabled>true</enabled>
   </snapshots>
   <releases>
     <enabled>false</enabled>
   </releases>
 </pluginRepository>
</pluginRepositories>


 <distributionManagement></distributionManagement>

 <profiles></profiles>
</project>


The build-hibernate.xml file is below:

<?xml version="1.0"?>
<project name="hibernate">
 <target name="hibernate">
   <echo>!!!This is a test of the generate-sources task!!!</echo>
 </target>

</project>

Reply via email to