Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 将ojdbc与SoapUI结合使用';s maven插件_Oracle_Maven_Jdbc_Groovy_Soapui - Fatal编程技术网

Oracle 将ojdbc与SoapUI结合使用';s maven插件

Oracle 将ojdbc与SoapUI结合使用';s maven插件,oracle,maven,jdbc,groovy,soapui,Oracle,Maven,Jdbc,Groovy,Soapui,我遇到了一个问题,我不知道发生了什么,所以我决定寻求帮助。 我正在使用SoapUI的Maven插件,在我的pom.xml中有以下内容: <plugin> <groupId>com.smartbear.soapui</groupId> <artifactId>soapui-maven-plugin</artifactId> <version>4.6.1</version> ... </plugin>

我遇到了一个问题,我不知道发生了什么,所以我决定寻求帮助。 我正在使用SoapUI的Maven插件,在我的pom.xml中有以下内容:

<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>4.6.1</version>
...
</plugin>
我已经在SoapUI的项目中包含了相同的ojdbc6.jar。相同的文件-在Maven项目和SoapUI中。 我的问题是:
为什么我使用Maven获得
java.sql.SQLException:jdbc:oracle:thin:@xxxxxxxxx
没有找到合适的驱动程序?当我在SoapUI中运行它时,一切都正常工作,没有错误,没有异常。。。非常感谢您的帮助

您需要在插件中定义JDBC依赖项,而不是在项目中:

        <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>

com.smartbear.soapui
soapui pro maven插件
4.6.1
...
...
com.oracle
ojdbc6
11.2.0.3

尽管我添加了依赖项?@user2062360(来自Groovy),但我仍然看到了相同的错误,您还需要注册驱动程序:可能重复的
import java.sql.*;
def path="jdbc:oracle:thin:@xxxxxxxxxxxxx"
def username='xxxxx'
def password='xxxxx'
Connection conn = DriverManager.getConnection(path, username, password)    /// Error here.
        <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>