Soapui maven插件ssl主机参数

时间:2014-09-16 16:34:02

标签: maven soapui

我们有一组使用soapui maven插件通过maven项目运行的soapui测试,该插件也是由Jenkins工作运行的。

由于我们有各种各样的环境,我们会通过"主机"参数通过环境,从Jenkins到Maven构建。

有一个<host>${HOST}</host>元素允许我们配置主机。问题是,当在参数值中添加协议前缀时,maven插件似乎不喜欢:

<host>example.com</host>可行吗

<host>https://example.com</host>无法工作(java.net.UnknownHostException:https)

因此,如果我不被允许提供协议前缀,那么我就不知道如何告诉maven soapui插件主机正在使用ssl。

以下是我们正在使用的pom.xml中的配置:

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-pro-maven-plugin</artifactId>
            <version>5.0.0</version>
            <dependencies>
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>sqljdbc4</artifactId>
                    <version>4.0</version>
                </dependency>
            </dependencies>
            <configuration>
                <projectFile>${project.build.directory}/test-classes/my-soapui-project.xml</projectFile>
                <host>${HOST}</host>
                <junitReport>true</junitReport>
                <soapuiProperties>
                    <property>
                        <name>soapui.logroot</name>
                        <value>${project.build.directory}/soapui-logs/</value>
                    </property>
                </soapuiProperties>
                <outputFolder>${project.build.directory}/soapui-output</outputFolder>
            </configuration>
            <executions>
                <execution>
                    <id>first-tests</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <testSuite>first-TestSuite</testSuite>
                    </configuration>
                </execution>
                <execution>
                    <id>second-tests</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <testSuite>second-TestSuite</testSuite>
                    </configuration>
                </execution>
            </executions>
        </plugin>
...

编辑:基于Bistro的回答:

而不是使用<host>${HOST}</host>我现在使用<endpoint>${HOST}</endpoint>它可以解决问题。

1 个答案:

答案 0 :(得分:1)

您可以尝试添加<endpoint>参数吗? SoapUI论坛中的某个人有类似的问题,但能够通过添加此参数来解决连接问题。他确实提到它会导致另一个问题。但它值得一试。这是帖子link