Forum Discussion

Hebla's avatar
Hebla
Occasional Contributor
9 years ago
Solved

Problems setting up readyAPI and Maven..

Hi

 

I'm trying to set up ready API to run on Maven. I'm having trouble getting my configurations read.

 

Here's my pom.xml (Yes, it's way way to long, been trying to use the documentation on readyapi.smartbear.com/readyapi/integration/maven/ but's it quite francly really bad... the example POM.xml does not even contain valid XML, and they are in huge contrast to each other)

 

 

 

<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.anonym</groupId>
	<artifactId>anonym.0</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>anonym.0</name>
	<parent>
        <groupId>com.smartbear</groupId>
        <artifactId>ready-api</artifactId>
        <version>1.5.0</version>
    </parent>
	<properties>
		<do.junit.report>true</do.junit.report>
	</properties>
	<dependencies>
		<dependency>
            <groupId>com.smartbear</groupId>
            <artifactId>ready-api-runners</artifactId>
            <version>${project.version}</version>
        </dependency>	
        <dependency>
            <groupId>com.smartbear</groupId>
            <artifactId>ready-api-soapui-pro</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>activeQueryBuilder</groupId>
                    <artifactId>activeQueryBuilder</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.smartbear</groupId>
            <artifactId>ready-api-soapui</artifactId>
            <version>${project.version}</version>
          <exclusions>
                <exclusion>
                    <groupId>com.jgoodies</groupId>
                    <artifactId>forms</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>runtime</scope>
		</dependency>
	</dependencies>
	<!-- Adding SoapUI Maven plugin -->
	<!--pluginRepositories>
		<pluginRepository>
			<id>SmartBearPluginRepository</id>
			<url>http://www.soapui.org/repository/maven2/</url>
		</pluginRepository>
	</pluginRepositories-->
	<build>
		<plugins>
			<plugin>
				<dependencies>
					<dependency>
						<groupId>org.reflections</groupId>
						<artifactId>reflections</artifactId>
						<version>0.9.9-RC1</version>
					</dependency>
					<dependency>
						<groupId>org.apache.poi</groupId>
						<artifactId>poi-ooxml</artifactId>
						<version>3.10-FINAL</version>
						<exclusions>
							<exclusion>
								<groupId>org.apache.xmlbeans</groupId>
								<artifactId>xmlbeans</artifactId>
							</exclusion>
						</exclusions>
					</dependency>
				</dependencies>
				<groupId>com.smartbear</groupId>
				<artifactId>ready-api-maven-plugin</artifactId>
				<version>1.5.0</version>
				<executions>
					<!--execution>
						<id>Full_run</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<projectFile>C:\Workspace\soapui-integration-tests\API_Gateway\anonym.0.xml</projectFile>
							<testSuite>Main</testSuite>
							<testCase>Full_run</testCase>
							<junitReport>true</junitReport>
							<printReport>true</printReport>
							<exportAll>true</exportAll>
							<reportFormat>PDF</reportFormat>
							<reportType>TestCase Report</reportType>
							<reportName>maven_pdf_report</reportName>
							<outputFolder>C:\Workspace\soapui-integration-tests\API_Gateway\Results</outputFolder>
							<activeEnvironment>AITE - API GW Open proxy</activeEnvironment>
							<soapuiProperties>
								<property>
									<name>soapui.home</name>
									<value>C:\Program Files\SmartBear\SoapUI-5.2.0\bin</value>
								</property>
								<property>
									<name>soapui.scripting.library</name>
									<value>C:/Workspace/soapui-integration-tests/Library</value>
								</property>
							</soapuiProperties>
							<readyApiProperties>
								<property>
									<name>soapui.home</name>
									<value>C:/Program Files/SmartBear/ReadyAPI-1.4.1/bin</value>
								</property>
								<property>
									<name>soapui.scripting.library</name>
									<value>C:/Workspace/soapui-integration-tests/Library</value>
								</property>
							</readyApiProperties>
						</configuration>
					</execution-->
					<execution>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<id>p2</id>
						<configuration>
							<projectFile>C:\Workspace\soapui-integration-tests\API_Gateway\anonym.0.xml</projectFile>
							<testSuite>Main</testSuite>
							<testCase>Full_run</testCase>
							<outputFolder>C:\Workspace\soapui-integration-tests\API_Gateway\Results</outputFolder>
							<junitReport>true</junitReport>
							<printReport>true</printReport>
							<exportAll>true</exportAll>
							<reportFormat>"TestCase Report"</reportFormat>
							<reportName>maven_pdf_report</reportName>
							<outputFolder>C:\Workspace\soapui-integration-tests\API_Gateway\Results</outputFolder>
							<soapuiProperties>
								<property>
									<name>soapui.home</name> 
									<value>C:/Program Files/SmartBear/ReadyAPI-1.4.1/bin</value>
								</property>
						   </soapuiProperties>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>2.17</version>
				<configuration>
					<outputDirectory>${project.build.directory}/reports</outputDirectory>
					<reportsDirectories>
						<reportsDirectories>${project.build.directory}/reports</reportsDirectories>
					</reportsDirectories>
				</configuration>
			</plugin>
		</plugins>
	</reporting>   
</project>

 

 

 

 

Here is the mvn output:

 

 

C:\Workspace\soapui-integration-tests\API_Gateway>mvn com.smartbear:ready-api-maven-plugin:1.5.0:test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SCRAMBLE_1.0 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- ready-api-maven-plugin:1.5.0:test (default-cli) @ SCRAMBLE_1.0 ---
[WARNING] The POM for eviware:reports:jar:1.0 is missing, no dependency information available
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
[WARNING] No base packages specified - no classpath scanning will be done
[INFO] Hibernate Validator 4.1.0.Final
[INFO] Adding module 'com.smartbear.ready.cmd.CommandLineModule
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
11:22:11,037 INFO  [DefaultSoapUICore] initialized soapui-settings from [C:\Users\cc31028\soapui-settings.xml]
11:22:11,159 INFO  [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Workspace\soapui-integration-tests\Library]
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
[WARNING] Disabling database functionality since the database schema is not compatible with this version of Ready! API.
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
[INFO] Reflections took 59 ms to scan 1 urls, producing 44 keys and 340 values
[INFO] Reflections took 129 ms to scan 14 urls, producing 341 keys and 1478 values
11:22:13,276 INFO  [PluginManager] Adding plugin from [C:\Users\cc31028\.soapui\plugins\ready-uxm-plugin-1.0.1.jar]
11:22:13,279 INFO  [PluginManager] Adding plugin from [C:\Users\cc31028\.soapui\plugins\soapui-swagger-plugin-2.1.2-dist.jar]
[INFO] Reflections took 220 ms to scan 1 urls, producing 892 keys and 3747 values
11:22:13,529 INFO  [PluginManager] 2 plugins loaded in 254 ms
11:22:13,530 INFO  [DefaultSoapUICore] All plugins loaded
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
11:22:14,767 INFO  [DefaultSoapUICore] initialized soapui-settings from [C:\Users\cc31028\soapui-settings.xml]
[WARNING] System property 'soapui.home' is not set! Using this directory instead: .
[INFO] Reflections took 19 ms to scan 1 urls, producing 44 keys and 340 values
[INFO] Reflections took 99 ms to scan 14 urls, producing 341 keys and 1478 values
11:22:14,935 INFO  [PluginManager] Adding plugin from [C:\Users\cc31028\.soapui\plugins\ready-uxm-plugin-1.0.1.jar]
11:22:14,936 INFO  [PluginManager] Adding plugin from [C:\Users\cc31028\.soapui\plugins\soapui-swagger-plugin-2.1.2-dist.jar]
[INFO] Reflections took 233 ms to scan 1 urls, producing 892 keys and 3747 values
11:22:15,174 INFO  [PluginManager] 2 plugins loaded in 239 ms
11:22:15,175 INFO  [DefaultSoapUICore] All plugins loaded
11:22:15,473 INFO  [WsdlProject] Loaded project from [file:/C:/Workspace/soapui-integration-tests/API_Gateway/SCRAMBLE_1.0-soapui-project.xml]
11:22:15,854 INFO  [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Workspace\soapui-integration-tests\Library]
11:22:16,103 INFO  [SoapUIProTestCaseRunner] Running tests in project [SCRAMBLE-APIGW-FI-1.0]
11:22:16,106 INFO  [SoapUIProTestCaseRunner] Running Project [SCRAMBLE-APIGW-FI-1.0], runType = SEQUENTIAL
11:22:16,106 WARN  [WsdlProject] Not storing test run data for project 'SCRAMBLE-APIGW-FI-1.0' since there is no repository.
11:22:16,107 WARN  [WsdlProject] Not storing test run metadata for project 'SCRAMBLE-APIGW-FI-1.0' since there is no repository.
[WARNING] Not storing test run data for TestSuite 'Main' since there is no repository.
[WARNING] Not storing test run metadata for TestSuite 'Main' since there is no repository.
11:22:16,122 WARN  [WsdlTestCasePro] Not storing test run data for TestCase 'Authentication' since there is no repository.
11:22:16,122 WARN  [WsdlTestCasePro] Not storing test step run data (latest runs) for TestCase 'Authentication' since there is no database repository.

11:22:16,127 INFO  [SoapUIProTestCaseRunner] Running TestCase [Authentication]
11:22:16,130 INFO  [SoapUIProTestCaseRunner] running step [initiatheAuthentication]

 

 

1. My soapui.home is not set. This is not a big problem, but I would expect it to be set since I do set it...

 

2. It starts running all testsuites and testcases, not following the setup in the POM.xml.

 

I know I'm setting quite a lot of stuff in the pom.xml now, but I've been trying everything I can find....

 

Any help is greatly appresiated.

 

-Henrik

  • Hebla's avatar
    Hebla
    9 years ago

    I copied the <configuration> out of the <execution> tag, so it's not in both places. Then it seems to work. If I move it out instead, it tells me I can't have configuration tag there. Strage. Anyways, it's working now, even if the POM is ugly, so I'll close this thread, and start cleaning up the POM

5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Henrik,

     

    I’ve mentioned that you are using Maven plugin v. 1.5 and Ready! API 1.4.1. I recommend that you update to Ready! API 1.5 so that the versions of the product and the plugin will be the same.

    • Hebla's avatar
      Hebla
      Occasional Contributor

      I copied the <configuration> out of the <execution> tag, so it's not in both places. Then it seems to work. If I move it out instead, it tells me I can't have configuration tag there. Strage. Anyways, it's working now, even if the POM is ugly, so I'll close this thread, and start cleaning up the POM

      • osubbu's avatar
        osubbu
        New Contributor
        Hi Hebla,   Can you please post the updated pom.xml. I'm also facing similar issue with maven integration and the documentation in the company website is not clear.   Thanks, Subbu