简体   繁体   中英

Using SoapUI maven plugin with GitLab - dependencies could not be resolved

I've been having some difficulties setting up my SoapUI test in Gitlab pipeline. At first I was successful getting them to run in principle. By now I've added my real tests into the project and got into some problems with JDBC steps. I have both Oracle and Postgres connections in my steps. Can some of you tell me what I'm doing wrong?

At first I was getting connection errors left and right. Then I realized I probably need to add dependencies. I added

              <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>42.2.8</version>
              </dependency>

but nothing changed. I also added oracle driver but now I'm getting

[ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.5.0:test (default) on project dsa-otsusetugi-soapui-tests: Execution default of goal com.smartbear.soapui:soapui-maven-plugin:5.5.0:test failed: Plugin com.smartbear.soapui:soapui-maven-plugin:5.5.0 or one of its dependencies could not be resolved: Failed to collect dependencies at com.smartbear.soapui:soapui-maven-plugin:jar:5.5.0 -> com.oracle:ojdbc8:jar:12.2.0.1.0: Failed to read artifact descriptor for com.oracle:ojdbc8:jar:12.2.0.1.0: Could not transfer artifact com.oracle:ojdbc8:pom:12.2.0.1.0 from/to rmv_repo (http://repo.rmv/nexus/repository/maven-public/): Transfer failed for http://repo.rmv/nexus/repository/maven-public/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom: Unknown host repo.rmv: Name or service not known -> [Help 1]

What's interesting that I don't get any errors during the download phase.. https://pastebin.com/1HGXytJk

Currently my pom file containing dependencies looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>blaa.blaah</groupId>
<artifactId>blaa-blaah</artifactId>
<version>1.0-SNAPSHOT</version>
<name>BLAAHSoapUITests</name>

<properties>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.version>3.0.0</maven.version>
    <soapui.version>5.5.0</soapui.version>
    <surefire.version>2.20</surefire.version>
</properties>
<pluginRepositories>
    <pluginRepository>
        <id>SmartBearPluginRepository</id>
        <url>http://smartbearsoftware.com/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>
    <build>
    <plugins>
      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>properties-maven-plugin</artifactId>
         <version>1.0.0</version>
         <executions>
           <execution>
             <phase>initialize</phase>
             <goals>
               <goal>read-project-properties</goal>
             </goals>
             <configuration>
               <files>
                 <file>${project.basedir}/test.properties</file>
               </files>
             </configuration>
           </execution>
         </executions>
      </plugin>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>${soapui.version}</version>
            <configuration>
              <soapuiProperties>
                    <property>
                    <name>soapui.logroot</name>
                    <value>${project.basedir}/build-testlog/build-testlog-</value>
                    </property>
              </soapuiProperties>
                <projectFile>${project.basedir}/${projectfile}</projectFile>
                <projectProperties>
                    <value>END_POINT=${END_POINT}</value>
                    <value>USER_ID=${USER_ID}</value>
                </projectProperties>
                <outputFolder>${project.basedir}/build-testlog</outputFolder>
                <printReport>true</printReport>
                <junitReport>true</junitReport>
            </configuration>
            <dependencies>
              <dependency>
                  <groupId>com.smartbear.soapui</groupId>
                  <artifactId>soapui</artifactId>
                  <version>${soapui.version}</version>
                  <exclusions>
                      <exclusion>
                          <groupId>javafx</groupId>
                          <artifactId>jfxrt</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
              <dependency>
                  <groupId>com.oracle</groupId>
                  <artifactId>ojdbc8</artifactId>
                  <version>12.2.0.1.0</version>
              </dependency>
              <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>42.2.8</version>
              </dependency>
              <dependency>
                 <groupId>com.jgoodies</groupId>
                 <artifactId>forms</artifactId>
                 <version>1.2.1</version>
             </dependency>
            </dependencies>
            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<reporting>
    <outputDirectory>${project.basedir}/build/reports/html</outputDirectory>
</reporting>

Am I doing something wrong? Am I using wrong dependencies?

Thanks in advance.

If anyone is facing something similar then my problem, as it turned out, was that Gitlab runner didn't have permission to access the postgres database. It did get the driver, but couldn't connect due to security settings.

Anyhow I still had problems with oracle driver, since it's not publically in smartbear repo. What I did is that I added the driver locally with the help of this tutorial: https://gist.github.com/timmolderez/92bea7cc90201cd3273a07cf21d119eb

So in the end my pom looked something like this:

<pluginRepositories>
    <pluginRepository>
        <id>SmartBearPluginRepository</id>
        <url>https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/</url>
    </pluginRepository>
    <pluginRepository>
        <id>in-project</id>
        <name>In Project Repo</name>
        <url>file://${project.basedir}/lib</url>
    </pluginRepository>
</pluginRepositories>

and

             <dependency>
                 <groupId>oracle</groupId>
                 <artifactId>ojdbc</artifactId>
                 <version>6.0</version>
             </dependency>

groupId, artifactId and version (also folder names and jar, pom files, of course) named like the tutorial said.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM