1

I have faced a problem and I have no idea what's going on, so I decided to ask for help. I'm using SoapUI's plugin for Maven, got this in my pom.xml:

<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>4.6.1</version>
...
</plugin>

I also have the ojdbc dependency in pom.xml, like this:

<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>

And I have a test step in groovy, like this:

import java.sql.*;
def path="jdbc:oracle:thin:@xxxxxxxxxxxxx"
def username='xxxxx'
def password='xxxxx'
Connection conn = DriverManager.getConnection(path, username, password)    /// Error here.

I have included the same ojdbc6.jar in my SoapUI's project. The same files - in Maven project and in SoapUI. My question is: Why am I getting java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@xxxxxxxxxx using Maven? When I run it in SoapUI everything is working properly, no errors, no exceptions... Help would be really appreciated!

cfrick
  • 35,203
  • 6
  • 56
  • 68
0user0
  • 19
  • 1
  • Possible duplicate of [soapui maven plugin jms not found](http://stackoverflow.com/questions/27904150/soapui-maven-plugin-jms-not-found) –  Mar 22 '16 at 02:57

1 Answers1

2

You need to define the JDBC dependency in the plugin, not the project:

        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-pro-maven-plugin</artifactId>
            <version>4.6.1</version>
            <configuration>
                <projectFile>...</projectFile>
                ...
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>ojdbc6</artifactId>
                    <version>11.2.0.3</version>
                </dependency>
            </dependencies>
        </plugin>
SiKing
  • 10,003
  • 10
  • 39
  • 90
  • I still see the same error though I have added the dependency? – user2062360 Apr 17 '15 at 22:08
  • @user2062360 From Groovy, you also need to register the driver: https://www.soapui.org/scripting-properties/tips-tricks.html#10-Use-a-JDBC-Driver-from-inside-a-groovy-script – SiKing Oct 27 '16 at 16:54