Forum Discussion

zakaka421's avatar
zakaka421
Occasional Contributor
7 years ago
Solved

SoapUI Maven Project Properties POM not working

Hi all!

 

I have setup my SoapUI (v5.4) project initially at first with properties defined at the project level and successfully pass them down to the test suites, no problem. I have set up maven on my local and am able to successfully execute the SoapUI tests via soapui-maven-plugin (SmartBear version). I am now attempting to further add another layer of properties by adding the project properties to the POM file for Maven, however nothing is working for me. I am using SoapUI Open Source with the latest Maven. I am using SoapUI v4.6 through maven since I started with the example POM from the SoapUI doc site. I will take one property for example below.

 

The methods I have tried:

<projectProperties>
<projectProperty>jdbcUsername=username</projectProperty>
</projectProperties>
<projectProperties>
<value>jdbcUsername=username</value>
</projectProperties>
<globalProperties>
<globalProperty>jdbcUsername=username</globalProperty>
</globalProperties>
<globalProperties>
<value>jdbcUsername=username</value>
</globalProperties>

 

I've tried all these with and without double and single quotes. In my SoapUI project, the property is setup at the project level as jdbcUsername with a blank value. I've also tried this with ${#Project#jdbcUsername}. I also tried all of these variations at the Global level as well. I have also tried according to the solution found here and here with no success. I've followed all documentation on the soapui site and in the forums. I know my jdbc jar is working because I can set property values within SoapUI GUI and it will execute fine through Maven, but once I abstract them from SoapUI and set them in the POM file, the jdbc driver returns error message: 

 

Login failed for user ''.

This is how I can tell the properties from the POM file are not making it into the project's properties I have set. Is it required to have the property created in SoapUI at the project level? Either way, I tried it without. I feel like I've tried everything. 

 

ANY help is appreciated. Thanks!

  • Update:

     

    Finally figured it out. I moved the <configuration> tag in my pom.xml outside of the <execution> node but still within the <plugin> node like this:

     

    <plugin>
                    <groupId>com.smartbear.soapui</groupId>
    		<artifactId>soapui-maven-plugin</artifactId>
    		<version>5.4.0</version>
    		<configuration>
    			<projectFile>xxx-soapui-project.xml</projectFile>
    		    <printReport>true</printReport>
    		    <testFailIgnore>false</testFailIgnore>
    		    <projectProperties>
    			<value>jdbcUsername=xxx</value>
    		    </projectProperties>
    		</configuration>
    		<dependencies>
                        <dependency>
    			<groupId>xxx</groupId>
    			<artifactId>xxx</artifactId>
    			<version>xxx</version>
    		    </dependency>
                    </dependencies>    
                    <executions>
                        <execution>
                            <goals>
                                <goal>test</goal>
                            </goals>
    			<phase>test</phase>
                        </execution>
                    </executions>
    </plugin>

    After this, everything worked.

     

    Documentation should be updated!!! Hope this helps others.

     

    Thanks

4 Replies

  • zakaka421's avatar
    zakaka421
    Occasional Contributor

    Update:

     

    Finally figured it out. I moved the <configuration> tag in my pom.xml outside of the <execution> node but still within the <plugin> node like this:

     

    <plugin>
                    <groupId>com.smartbear.soapui</groupId>
    		<artifactId>soapui-maven-plugin</artifactId>
    		<version>5.4.0</version>
    		<configuration>
    			<projectFile>xxx-soapui-project.xml</projectFile>
    		    <printReport>true</printReport>
    		    <testFailIgnore>false</testFailIgnore>
    		    <projectProperties>
    			<value>jdbcUsername=xxx</value>
    		    </projectProperties>
    		</configuration>
    		<dependencies>
                        <dependency>
    			<groupId>xxx</groupId>
    			<artifactId>xxx</artifactId>
    			<version>xxx</version>
    		    </dependency>
                    </dependencies>    
                    <executions>
                        <execution>
                            <goals>
                                <goal>test</goal>
                            </goals>
    			<phase>test</phase>
                        </execution>
                    </executions>
    </plugin>

    After this, everything worked.

     

    Documentation should be updated!!! Hope this helps others.

     

    Thanks

    • soalri's avatar
      soalri
      Occasional Contributor

      Hi,

      I do the same thing and it's not working for me at all, after project execution with maven, when I open my project with SoapUI I still not have the Project properties, please any help ! Thanks a lot 

       

      <plugins>
      <!-- SoapUI plugin -->
      <plugin>
      <groupId>com.smartbear.soapui</groupId>
      <artifactId>soapui-maven-plugin</artifactId>
      <!-- version de soapui -->
      <version>5.3.0</version>
      <configuration>
      <projectFile>${project.basedir}</projectFile>
      <junitReport>true</junitReport>
      <exportAll>false</exportAll>
      <printReport>true</printReport>
      <testFailIgnore>true</testFailIgnore>
      <outputFolder>target/${soapui.results.directory}</outputFolder>
      <projectProperties>
      <value>ENV=xxx</value>
      </projectProperties>

      <!-- resolve problem of Protocol version TLS in SoapUI -->
      <soapuiProperties>
      <property>
      <name>soapui.https.protocols</name>
      <value>TLSv1.2,SSLv3</value>
      </property>


      </soapuiProperties>
      <properties>

      <property>
      <name>listener</name>
      <value>io.qameta.allure.junit4.AllureJunit4</value>
      </property>
      </properties>
      </configuration>

      <executions>
      <execution>
      <id>test-report-SoapUI</id>
      <phase>test</phase>
      <goals>
      <goal>test</goal>
      </goals>


      </execution>
      </executions>

      </plugin>

       

       

      • zakaka421's avatar
        zakaka421
        Occasional Contributor
        1. Just to confirm, did you close the "plugins" node. I see "plugin" is closed, how about "plugins".
        2. Is it ONLY the project properties that are not working?
        3. If so, double check the properties are located in the correct place within the SOAPUI suite.
        4. If so, ensure the casing matches.

        Hope this helps.