/ Published in: Java
Make sure you compile before rnning hibernate3:hbm2ddl!
mvn compile hibernate3:hbm2ddl
mvn compile hibernate3:hbm2ddl
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>deng</groupId> <artifactId>myhibernatejpa</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>auction Maven Webapp</name> <url>http://maven.apache.org</url> <profiles> <profile> <activation> <activeByDefault></activeByDefault> </activation> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> </dependencies> </profile> </profiles> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.0.5</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.5.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.3.1.ga</version> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl104-over-slf4j</artifactId> <version>1.4.3</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>hibernate3-maven-plugin</artifactId> <version>2.0-alpha-2</version> <configuration> <components> <component> <name>hbm2ddl</name> </component> </components> <componentProperties> <implementation>jpaconfiguration</implementation> <drop>true</drop> <create>true</create> <export>true</export> <jdk5>true</jdk5> <persistenceunit>default</persistenceunit> </componentProperties> </configuration> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.0.5</version> </dependency> </dependencies> </plugin> </plugins> </build> <repositories> <repository> <id>jboss</id> <url>http://repository.jboss.com/maven2</url> <releases> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>jboss-snapshot</id> <url>http://snapshots.jboss.org/maven2</url> <releases> </releases> <snapshots> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>codehaus-plugins</id> <url>http://repository.codehaus.org/org/codehaus/mojo/</url> <releases> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>jboss-plugins</id> <url>http://repository.jboss.com/maven2</url> <releases> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>jboss-snapshot-plugins</id> <url>http://snapshots.jboss.org/maven2</url> <releases> </releases> <snapshots> </snapshots> </pluginRepository> </pluginRepositories> </project>