Forum Discussion

agalli's avatar
agalli
New Contributor
12 years ago

Mockservice and testsuites with Maven plugin

Hi, I'm trying to run both mockservices and testsuites from one pom.xml file.
Is this possible?

Thanks
  • agalli's avatar
    agalli
    New Contributor
    Hi, I have tried but I can't run both the mock and the tests at the same time
    I'm running the command mvn eviware:maven-soapui-plugin:mock
    This is my pom.xml:

    <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>eviwarePluginRepository</id>
    <url>http://www.eviware.com/repository/maven2/</url>
    </pluginRepository>
    </pluginRepositories>
    <build>
    <plugins>
    <!plugin>
    <groupId>eviware</groupId>
    <artifactId>maven-soapui-plugin</artifactId>
    <version>4.5.1</version>
    <configuration>
    <projectFile>/app/mock.xml</projectFile>
    <noBlock>true</noBlock>
    <port>8088</port>
    </configuration>
    <executions>
    <execution>
    <phase>test</phase>
    <goals>
    <goal>mock</goal>
    <goal>test</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <groupId>eviware</groupId>
    <artifactId>maven-soapui-plugin</artifactId>
    <version>4.5.1</version>
    <configuration>
    <projectFile>/app/TestSuiteProject.xml</projectFile>
    <outputFolder>/home/developer/Documents/pom</outputFolder>
    </configuration>
    <executions>
    <execution>
    <goals>
    <goal>mock</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
    </project>
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hi,
    you should add eviware:maven-soapui-plugin:test to your maven command to also run the test
    in your pom, you should only declare the soapui plugin once
    you do not need to configure any executions with the maven command option you use
    you only need to configure executions if you want to bind the plugin execution to maven standard steps. In your case, this should work with "mvn test"