How to handle multiple src files in dbunit-maven-plugin

dbunit-maven-plugin 1.0-SNAPSHOT supported release expressing multiple src files in the source tag, as you do the same in version 1.0-beta-3, which supports only one src tag

             <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>dbunit-maven-plugin</artifactId>
                <version>${dbunit-maven-plugin.version}</version>

                <executions>
                    <execution>
                        <id>populate sample data</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>operation</goal>
                        </goals>
                        <configuration>
                            <format>flat</format>
                            <sources>
                                <source>src/main/resources/seeddata.xml</source>
                                <source>src/test/resources/testdata.xml</source>
                            </sources>
                            <skip>${db.dataset.skip}</skip>
                        </configuration>
                    </execution>
                </executions>
           </plugin>
+3
source share
3 answers

This improvement is due to MBUNIT-3 , which is indeed the last to release 1.0-beta-3. Therefore, if you want this function, use 1.0-SNAPSHOT or apply the change in r10226 directly to the 1.0-beta-3 branches (get the patch for diffs , apply it and compile your version 1.0-beta3-patched).

, , , 1.0-SNAPSHOT. SNAPSHOT , .

: , , dbunit-maven- SNAPSHOT . , , . :

svn checkout http://svn.codehaus.org/mojo/trunk/mojo/dbunit-maven-plugin/ dbunit-maven-plugin
cd dbunit-maven-plugin
mvn install

, , 100% , .

+4

, . , .

+1

I was able to use several source files after creating version 1.0-SNAPSHOT from sources using the instructions given by Pascal Thivent. This helped me to keep multiple records of execution units.

Thanks Pascal !.

Here is the code:

 <executions>
   <execution>
   <id>Common</id>
   <phase>process-test-resources</phase>
   <goals>
       <goal>operation</goal>
    </goals>
    <configuration>
       <format>flat</format>
       <verbose>2</verbose>
       <sources>
           <source>first.xml</source>
           <source>second.xml</source>
       </sources>
       <skip>${maven.test.skip}</skip>
    </configuration>
    </execution>
</executions>
+1
source

Source: https://habr.com/ru/post/1730349/


All Articles