Menu

#3 Provide example for use of queries in maven plugin

1.0-SNAPSHOT
closed
None
2021-10-30
2009-10-21
sellerjd
No

I'm trying to figure out how to use the "queries" parameter for the maven2 export goal. Can you please provide an example on your website? I could not figure out how to search the mail archives to see if this had been asked/answered before. Multiple searches in the BUG and FEATURE REQUEST trackers produced no similar requests.

Discussion

  • matthias g

    matthias g - 2009-10-21

    Hi,
    I'm not sure whether you are aware of the fact that the dbunit maven plugin is currently maintained on a different site: http://mojo.codehaus.org/dbunit-maven-plugin/export-mojo.html
    You can find an example for the export goal at http://mojo.codehaus.org/dbunit-maven-plugin/examples/export-full.html

    Here an example that should work (but I did not test this, so feel free to correct me if I'm wrong):

    <executions>
    <execution>
    <phase>test</phase>
    <goals>
    <goal>export</goal>
    </goals>
    <!-- specific configurations -->
    <configuration>
    <format>xml</format>
    <dest>target/dbunit/export.xml</dest>
    <queries>
    <query implementation="org.dbunit.ant.Query">
    <name>myQueryName</name>
    <sql>select * from MYTAB</sql>
    </query>
    </queries>
    </configuration>
    </execution>
    [...]
    </executions>

    Please let me know if it works.

    rgds,
    matthias

     
  • sellerjd

    sellerjd - 2009-10-21

    Thanks gommma, I didn't realize I was posting in the wrong place, my bad.

    Your example is exactly what I was looking for and works great. I wasn't sure how to specify the xml element as a "Query" type, I see you do so by adding "implementation = ...".

    Much appreciated!

     
  • matthias g

    matthias g - 2009-11-03

    I committed the example to the svn trunk rev. 1094 and with the next release of the dbunit-maven-plugin (newly hosted in dbunit sf SVN) it will be on the site.
    regards,
    matthias

     
  • matthias g

    matthias g - 2009-11-03
    • status: open --> closed-fixed
     
  • Jeff Jensen

    Jeff Jensen - 2021-10-30

    Ticket moved from /p/dbunit/feature-requests/143/

    Can't be converted:

    • _priority: 5
    • _milestone:
     
  • Jeff Jensen

    Jeff Jensen - 2021-10-30
    • status: closed-fixed --> closed
    • assigned_to: matthias g
    • Milestone: --> 1.0-SNAPSHOT
     

Log in to post a comment.

MongoDB Logo MongoDB