Forum Discussion

seanzi's avatar
seanzi
New Contributor
12 years ago

Changing database connections via Maven

Hi, I'm having problems trying to find a way to change database conneections for my SoapUI project via Maven. I'm trying to run my tests in different environments (eg. I need to run all of my tests against MySQL,SQLServer,Oracle, ect.), is this possible to do through the SoapUI plugin for Maven? Is there any way to do this without having to do it manually in SoapUI? Thanks!

4 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    If you have -Pro, you can use the JDBC connections coupled with Environments definition.
    If you have non-Pro, you can use Property expansion to define the database server.
  • seanzi's avatar
    seanzi
    New Contributor
    I have 2 environments set up but when I switch between them even in soapUI the jdbc requests don't change where they are pointing, then when I run maven, the environment variable seemingly does nothing at all.

    <configuration>
    <projectFile>tests/test-soapui-project.xml</projectFile>
    <outputFolder>tests/report/</outputFolder>
    <environment>mysql</environment>
    <printReport>true</printReport>
    <junitReport>true</junitReport>
    </configuration>
    Say the other environment that was used before was called mssql, it will still use those jdbc connections for the test ran with the above pom.


    Can you elaborate on the second suggestion?