<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dbunit-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>classes12</artifactId>
<version>10.2.0.4</version>
</dependency>
</dependencies>
<configuration>
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:thin:@127.0.0.1:1521:orcl</url>
<username>user</username>
<password>passwd</password>
<schema>schema_new</schema>
</configuration>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>operation</goal>
</goals>
<configuration>
<type>CLEAN_INSERT</type>
<src>src/test/data/user.xml</src>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
运行mvn -DskipTests=false test命令的时候就会执行DBunit的CLEAN_INSERT操作了。
即:先执行CLEAN操作,然后执行INSERT。
另外,同时使用多个<src>filename.xml</src>不好用,
每个<execution>只能使用一个<src></src>,就是只能使用一个文件。
如果配置了多个文件,那么生效的仅仅是最后一个xml文件。
分享到:
相关推荐
maven-dbunit-plugin-1.6.jar
dbunit-maven-plugin 扩展和增强Codehaus的dbunit-maven-plugin项目
maven-dbunit-plugin-1.8.jar
maven-dbunit-plugin-1.7.jar
maven-dbunit-plugin-1.4.jar
maven-dbunit-plugin-1.2.jar
maven-dbunit-plugin-1.1.jar
maven-dbunit-plugin-1.0.jar
maven-dbunit-plugin-20030818.022735.jar
maven-dbunit-plugin-20030814.080708.jar
maven-dbunit-plugin-20030413.024213.jar
lotaris-dbunit-maven-plugin 用于创建/删除域、部署应用程序和管理资源的插件。用法将以下依赖项放入您的 pom.xml < plugin>< groupId>...
这是完整的POM文件,其中包含我们需要的所有依赖项: 4.0.0示例spring-dbunit-example 0.0.1-SNAPSHOT <spring> 3.0.5.RELEASE </spring> <hibernate> 3.5.6-Final </hibernate> jboss true false org.apache.maven....