Maven2 pom.xml for HibernateJPA+Mysql+HibernateTools


/ Published in: Java
Save to your folder(s)

Make sure you compile before rnning hibernate3:hbm2ddl!

mvn compile hibernate3:hbm2ddl


Copy this code and paste it in your HTML
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>deng</groupId>
  5. <artifactId>myhibernatejpa</artifactId>
  6. <packaging>jar</packaging>
  7. <version>1.0-SNAPSHOT</version>
  8. <name>auction Maven Webapp</name>
  9. <url>http://maven.apache.org</url>
  10.  
  11. <profiles>
  12. <profile>
  13. <activation>
  14. <activeByDefault></activeByDefault>
  15. </activation>
  16. <dependencies>
  17. <dependency>
  18. <groupId>javax.servlet</groupId>
  19. <artifactId>servlet-api</artifactId>
  20. <version>2.5</version>
  21. <scope>provided</scope>
  22. </dependency>
  23. <dependency>
  24. <groupId>javax.servlet.jsp</groupId>
  25. <artifactId>jsp-api</artifactId>
  26. <version>2.1</version>
  27. <scope>provided</scope>
  28. </dependency>
  29. </dependencies>
  30. </profile>
  31. </profiles>
  32. <dependencies>
  33. <dependency>
  34. <groupId>junit</groupId>
  35. <artifactId>junit</artifactId>
  36. <version>4.4</version>
  37. <scope>test</scope>
  38. </dependency>
  39. <dependency>
  40. <groupId>javax.servlet</groupId>
  41. <artifactId>jstl</artifactId>
  42. <version>1.1.2</version>
  43. </dependency>
  44. <dependency>
  45. <groupId>taglibs</groupId>
  46. <artifactId>standard</artifactId>
  47. <version>1.1.2</version>
  48. </dependency>
  49. <dependency>
  50. <groupId>mysql</groupId>
  51. <artifactId>mysql-connector-java</artifactId>
  52. <version>5.0.5</version>
  53. </dependency>
  54. <dependency>
  55. <groupId>org.hibernate</groupId>
  56. <artifactId>hibernate</artifactId>
  57. <version>3.2.5.ga</version>
  58. </dependency>
  59. <dependency>
  60. <groupId>org.hibernate</groupId>
  61. <artifactId>hibernate-entitymanager</artifactId>
  62. <version>3.3.1.ga</version>
  63. </dependency>
  64. <dependency>
  65. <groupId>javax.persistence</groupId>
  66. <artifactId>persistence-api</artifactId>
  67. <version>1.0</version>
  68. <scope>compile</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>ch.qos.logback</groupId>
  72. <artifactId>logback-classic</artifactId>
  73. <version>0.9.8</version>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.slf4j</groupId>
  77. <artifactId>jcl104-over-slf4j</artifactId>
  78. <version>1.4.3</version>
  79. </dependency>
  80. </dependencies>
  81. <build>
  82. <plugins>
  83. <plugin>
  84. <artifactId>maven-compiler-plugin</artifactId>
  85. <configuration>
  86. <source>1.5</source>
  87. <target>1.5</target>
  88. </configuration>
  89. </plugin>
  90. <plugin>
  91. <groupId>org.codehaus.mojo</groupId>
  92. <artifactId>hibernate3-maven-plugin</artifactId>
  93. <version>2.0-alpha-2</version>
  94. <configuration>
  95. <components>
  96. <component>
  97. <name>hbm2ddl</name>
  98. </component>
  99. </components>
  100. <componentProperties>
  101. <implementation>jpaconfiguration</implementation>
  102. <drop>true</drop>
  103. <create>true</create>
  104. <export>true</export>
  105. <jdk5>true</jdk5>
  106. <persistenceunit>default</persistenceunit>
  107. </componentProperties>
  108. </configuration>
  109. <dependencies>
  110. <dependency>
  111. <groupId>mysql</groupId>
  112. <artifactId>mysql-connector-java</artifactId>
  113. <version>5.0.5</version>
  114. </dependency>
  115. </dependencies>
  116. </plugin>
  117. </plugins>
  118. </build>
  119.  
  120.  
  121. <repositories>
  122. <repository>
  123. <id>jboss</id>
  124. <url>http://repository.jboss.com/maven2</url>
  125. <releases>
  126. </releases>
  127. <snapshots>
  128. <enabled>false</enabled>
  129. </snapshots>
  130. </repository>
  131. <repository>
  132. <id>jboss-snapshot</id>
  133. <url>http://snapshots.jboss.org/maven2</url>
  134. <releases>
  135. </releases>
  136. <snapshots>
  137. </snapshots>
  138. </repository>
  139. </repositories>
  140. <pluginRepositories>
  141. <pluginRepository>
  142. <id>codehaus-plugins</id>
  143. <url>http://repository.codehaus.org/org/codehaus/mojo/</url>
  144. <releases>
  145. </releases>
  146. <snapshots>
  147. <enabled>false</enabled>
  148. </snapshots>
  149. </pluginRepository>
  150. <pluginRepository>
  151. <id>jboss-plugins</id>
  152. <url>http://repository.jboss.com/maven2</url>
  153. <releases>
  154. </releases>
  155. <snapshots>
  156. <enabled>false</enabled>
  157. </snapshots>
  158. </pluginRepository>
  159. <pluginRepository>
  160. <id>jboss-snapshot-plugins</id>
  161. <url>http://snapshots.jboss.org/maven2</url>
  162. <releases>
  163. </releases>
  164. <snapshots>
  165. </snapshots>
  166. </pluginRepository>
  167. </pluginRepositories>
  168. </project>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.