Forum Discussion

dumbuser's avatar
dumbuser
Occasional Contributor
5 years ago
Solved

Using maven plugin with GitLab - dependencies could not be resolved

Hi.


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

 

[INFO] Downloading from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom
[INFO] Downloading from rmv_repo: http://repo.rmv/nexus/repository/maven-public/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom
[INFO] Downloading from smartbear-sweden-repository: http://www.soapui.org/repository/maven2/com/oracle/ojdbc8/12.2.0.1.0/ojdbc8-12.2.0.1.0.pom
[INFO] Downloading from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/postgresql/42.2.8/postgresql-42.2.8.pom
[INFO] Downloaded from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/postgresql/42.2.8/postgresql-42.2.8.pom (12 kB at 12 kB/s)
[INFO] Downloading from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/pgjdbc-core-parent/1.1.6/pgjdbc-core-parent-1.1.6.pom
[INFO] Downloaded from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/pgjdbc-core-parent/1.1.6/pgjdbc-core-parent-1.1.6.pom (18 kB at 25 kB/s)
[INFO] Downloading from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/pgjdbc-versions/1.1.6/pgjdbc-versions-1.1.6.pom
[INFO] Downloaded from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/org/postgresql/pgjdbc-versions/1.1.6/pgjdbc-versions-1.1.6.pom (23 kB at 32 kB/s)
[INFO] Downloading from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/com/jgoodies/forms/1.2.1/forms-1.2.1.pom
[INFO] Downloaded from SmartBearPluginRepository: http://smartbearsoftware.com/repository/maven2/com/jgoodies/forms/1.2.1/forms-1.2.1.pom (3.4 kB at 4.9 kB/s)


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



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.

1 Reply

  • dumbuser's avatar
    dumbuser
    Occasional Contributor

    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.