Question

I am using soapUI maven plugin to create a multi-module maven-soapUi project. I have several child maven projects each having their own project.xml and pom.xml files. When I run each child project separately, it works fine. But when I run the parent project, it looks for the project.xml file in the parent root directory instead of the child directory and hence fails, is there a solution to this?

Child POM

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

   <parent>
         <groupId>com.project</groupId>
         <artifactId>project-test</artifactId>
         <version>1.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
   </parent>

   <name>submodule SoapUI tests</name>
   <groupId>com.prject</groupId>
   <artifactId>project-submodule-test</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>jar</packaging>
   <description>Submodule SoapUI tests</description>    
   <pluginRepositories>   
        <pluginRepository>      
            <id>eviwarePluginRepository</id>      
            <url>http://www.eviware.com/repository/maven2/</url>   
        </pluginRepository>
   </pluginRepositories> 
   <build>
      <plugins> 
         <plugin>
            <groupId>eviware</groupId>
            <artifactId>maven-soapui-pro-plugin</artifactId>
            <version>4.5.0</version>
            <dependencies>
            <dependency>
                <groupId>com.microsoft.sqlserver</groupId>               
                <artifactId>sqljdbc4</artifactId>               
                <version>3.0</version>   
            </dependency>
          </dependencies>
        <executions>
               <execution>
                  <id>soapUI</id>
                  <goals>
                     <goal>test</goal> 
                  </goals>
                  <phase>test</phase>           
               </execution>
            </executions>                       
            <configuration>
               <projectFile>submodule.xml</projectFile>
               <outputFolder>Reports</outputFolder>
               <junitReport>true</junitReport>
               <printReport>false</printReport>
               <projectProperties/>
            </configuration>
         </plugin>   
      </plugins>
   </build>          
</project>

Parent POM

    <?xml version="1.0" encoding="UTF-8"?>
    <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.project</groupId>
    <artifactId>project-test</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>SoapUI tests</name>

    <modules>
            <module>submodule</module>
    </modules>
</project>
Was it helpful?

Solution

A small change in the child pom.xml fixed this.

Change project file path from

<projectFile>submodule.xml</projectFile>

to

<projectFile>{basedir}/submodule.xml</projectFile>

In case someone comes here looking for a solution for something similar...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top