在网上搜了好久发现的都是些好旧的方法大多不能用了 今天浏览pom文件的时候忽然发现这么一块:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>annotationconfiguration</implementation>
<!-- Use 'jpaconfiguration' if you're using JPA. -->
<!--<implementation>jpaconfiguration</implementation> -->
</component>
</components>
<componentProperties>
<drop>true</drop>
<jdk5>true</jdk5>
<propertyfile>target/classes/jdbc.properties</propertyfile>
<skip>${skipTests}</skip>
</componentProperties>
</configuration>
<executions>
<execution>
<phase>process-test-resources</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>
</dependencies>
</plugin>
原来这个修改表的测试操作是可以跳过的,只要把上面的
<skip>${skipTests}</skip>
中的
${skipTests}
改成true就可以了,但是貌似更好的方法是在执行run或者install的命令的时候加一个参数,如下图:
这样就可以不用修改pom文件了,而且在需要的时候只要去掉这个参数就可方便的重新建立表结构了
不知道自己是不是又小白了…………貌似大虾们都会这一步……= =!