carlosgmercado
carlosgmercado

Reputation: 284

"Failed to load sopaui project File" with maven

Hi i'm just trying to achieve a simple task that is to run a simple test SOAP UI project using maven. So my simple project do run without any problems from the SOAP UI 5.0.0 IDE. My POM file is:

<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>com.smartbear.samples</groupId>
    <artifactId>soapui-maven2-plugin</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Maven 2 SoapUI Sample</name>
    <url>http://maven.apache.org</url>
    <pluginRepositories>
        <pluginRepository>
            <id>SmartBearPluginRepository</id>
            <url>http://www.soapui.org/repository/maven2/</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui-maven-plugin</artifactId>
                <version>5.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.6</version>
                    </dependency>
                </dependencies>    
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <projectFile>${project.basedir}/Test-soapui-project</projectFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

and for some reason the plugin is using the default project file name, even with the fact that id specified that within the configuration/project file paramenter. Here is the error:

C:\Users\Carlos\maven-soapui>mvn com.smartbear.soapui:soapui-maven-plugin:5.0.0:test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 2 SoapUI Sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- soapui-maven-plugin:5.0.0:test (default-cli) @ soapui-maven2-plugin ---
SoapUI 5.0.0 Maven2 TestCase Runner
17:13:13,910 WARN  [SoapUI] Missing folder [C:\Users\Carlos\maven-soapui\ext] for external libraries
17:13:14,061 INFO  [DefaultSoapUICore] initialized soapui-settings from [C:\Users\Carlos\soapui-settings.xml]
17:13:16,807 INFO  [SoapUI] File [C:\Users\Carlos\maven-soapui\soapui-maven2-plugin-soapui-project.xml] does not exist, tryin
g URL instead
17:13:16,808 ERROR [SoapUI] An error occurred [no protocol: soapui-maven2-plugin-soapui-project.xml], see error log for detai
ls
java.net.MalformedURLException: no protocol: soapui-maven2-plugin-soapui-project.xml
        at java.net.URL.<init>(URL.java:585)
        at java.net.URL.<init>(URL.java:482)
        at java.net.URL.<init>(URL.java:431)
        at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:236)
        at com.eviware.soapui.impl.wsdl.WsdlProjectFactory.createNew(WsdlProjectFactory.java:45)
        at com.eviware.soapui.impl.wsdl.WsdlProjectFactory.createNew(WsdlProjectFactory.java:28)
        at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:341)
        at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:162)
        at com.eviware.soapui.maven2.TestMojo.execute(TestMojo.java:117)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
[ERROR] java.lang.Exception: Failed to load SoapUI project file [soapui-maven2-plugin-soapui-project.xml]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.920s
[INFO] Finished at: Mon Jul 21 17:13:16 BOT 2014
[INFO] Final Memory: 15M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.0.0:test (default-cli) on project soapui-maven2-plu
gin: SoapUI Test(s) failed: SoapUI Test(s) failed:
[ERROR] Failed to load SoapUI project file [soapui-maven2-plugin-soapui-project.xml]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

anyone that could point me where what this could be?

Upvotes: 1

Views: 8786

Answers (5)

Kamyk.pl
Kamyk.pl

Reputation: 349

I have found two solutions for this issue, one based on plugins default settings and one on custom settings:

USE DEFAULT SETTINGS:

  1. name your file with soap-ui project in following pattern: [YOUR-NAME]-soapui-project.xml. Use [YOUR-NAME] as artifact-id.
  2. Place that file in the same location as your pom.xml file
  3. Remove configuration section from pom.xml file

    <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>com.smartbear.samples</groupId>
    <artifactId>[YOUR-NAME]</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Maven 2 SoapUI Sample</name>
    <url>http://maven.apache.org</url>
    <pluginRepositories>
        <pluginRepository>
            <id>SmartBearPluginRepository</id>
            <url>http://www.soapui.org/repository/maven2/</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui-maven-plugin</artifactId>
                <version>5.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.6</version>
                    </dependency>
                </dependencies>    
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>                             
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    

  4. Run following command

    mvn com.smartbear.soapui:soapui-maven-plugin:test

CUSTOM FILE NAME

  1. Move configuration from execution section to plugin section. So pom.xml may look 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>com.smartbear.samples</groupId>
    <artifactId>[YOUR-NAME]</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Maven 2 SoapUI Sample</name>
    <url>http://maven.apache.org</url>
    <pluginRepositories>
        <pluginRepository>
            <id>SmartBearPluginRepository</id>
            <url>http://www.soapui.org/repository/maven2/</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui-maven-plugin</artifactId>
                <version>5.0.0</version>
                <configuration>
                  <projectFile>[PATH_TO_YOUR_FILE]</projectFile>         
                </configuration>     
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.6</version>
                    </dependency>
                </dependencies>    
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>                             
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    

  2. Run following command

    mvn com.smartbear.soapui:soapui-maven-plugin:test

Upvotes: 3

test
test

Reputation: 1

I had a similar problem. If you move the projectFile tag to be after the dependencies close tag and before the executions start tag, things will probably come right.

Upvotes: 0

J.Chan
J.Chan

Reputation: 98

I am facing the same error. But I can run a mvn test and it works fine.

it's like the projectFile element is ignored when calling

>mvn com.smartbear.soapui:soapui-maven-plugin:5.0.0:test

For me it just concatenates the maven project's root folder with the Soapui project's name.

the following is an extract from the log. You can see that the projectFile is well configured.

[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          com.smartbear.soapui:soapui-maven-plugin:5.0.0:test (A)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <domain>${soapui.domain}</domain>
  <endpoint>${soapui.endpoint}</endpoint>
  <exportAll>${soapui.exportAll}</exportAll>
  <globalProperties>${soapui.globalProperties}</globalProperties>
  <host>${soapui.host}</host>
  <interactive>${soapui.interactive}</interactive>
  <junitReport>true</junitReport>
  <outputFolder>${soapui.outputFolder}</outputFolder>
  <password>${soapui.password}</password>
  <printReport>${soapui.printReport}</printReport>
  <projectFile default-value="${project.artifactId}-soapui-project.xml">C:/workspace/StockQuote/resources/test/StockQuote-soapui-project.xml</projectFile>
  <projectPassword>${soapui.project.password}</projectPassword>
  <projectProperties>${soapui.projectProperties}</projectProperties>
  <saveAfterRun>${}</saveAfterRun>
  <settingsFile>${soapui.settingsFile}</settingsFile>
  <settingsPassword>${soapui.settingsFile.password}</settingsPassword>
  <skip>${soapui.skip}</skip>
  <soapuiProperties>${soapuiProperties}</soapuiProperties>
  <testCase>${soapui.testcase}</testCase>
  <testFailIgnore>${soapui.testFailIgnore}</testFailIgnore>
  <testSuite>${soapui.testsuite}</testSuite>
  <username>${soapui.username}</username>
  <wssPasswordType>${soapui.wssPasswordType}</wssPasswordType>
</configuration>

scrolling down the log, I found that eventually it uses the default value :

[DEBUG] Configuring mojo com.smartbear.soapui:soapui-maven-plugin:5.0.0:test from plugin realm ClassRealm[plugin>com.smartbear.soapui:soapui-maven-plugin:5.0.0, parent: sun.misc.Launcher$AppClassLoader@107077e]
[DEBUG] Configuring mojo 'com.smartbear.soapui:soapui-maven-plugin:5.0.0:test' with basic configurator -->
[DEBUG]   (f) globalProperties = []
[DEBUG]   (f) projectFile = StockQuote-soapui-project.xml
[DEBUG]   (f) projectProperties = []
[DEBUG]   (f) soapuiProperties = {}
[DEBUG] -- end configuration --

I also tried setting a different soapui project's name and I get the same result: using the default value

Upvotes: 0

Waruna Perera
Waruna Perera

Reputation: 68

your project file needs to have the .xml extension. Please try again with that. I had the similar error and found file path was incorrect. If you really wish to investigate more use GitHUb source code available.

Upvotes: 0

SiKing
SiKing

Reputation: 10329

You either have non-Pro and a simple project file, which ends in .xml. So you would need to have both of the following in your pom:

<artifactId>soapui-maven-plugin</artifactId>
<projectFile>simple-test-soapui-project.xml</projectFile>

Or you have a Pro simple project, in which case you need both of the following in your pom:

<artifactId>soapui-pro-maven-plugin</artifactId>
<projectFile>simple-test-soapui-project.xml</projectFile>

Or you have a Pro composite project, which does not end in .xml, in which case you need both of the following in your pom:

<artifactId>soapui-pro-maven-plugin</artifactId>
<projectFile>simple-test-soapui-project</projectFile>

In your example you are using the non-Pro Maven plugin, and using the composite project (does not end in .xml), which is definitely invalid! See additional information in SoapUI docs.

Upvotes: 0

Related Questions