多模块maven-soapUI项目问题

时间:2012-05-17 14:22:35

标签: maven-2 soapui multi-module

我正在使用soapUI maven插件来创建一个多模块的maven-soapUi项目。我有几个子maven项目,每个项目都有自己的project.xml和pom.xml文件。当我单独运行每个子项目时,它工作正常。但是当我运行父项目时,它会在父目录中查找project.xml文件而不是子目录,因此会失败,是否有解决方案呢?

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>

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

1 个答案:

答案 0 :(得分:1)

pom.xml中的一个小变化解决了这个问题。

更改项目文件路径
<projectFile>submodule.xml</projectFile>

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

如果有人来这里寻找类似的东西的解决方案......