2012-05-17 58 views
1

我正在使用soapUI maven插件來創建一個多模塊maven-soapUi項目。我有幾個子Maven項目,每個項目都有自己的project.xml和pom.xml文件。當我分別運行每個子項目時,它工作正常。但是當我運行父項目時,它會在父根目錄而不是子目錄中查找project.xml文件,因此失敗,是否有解決方案?多模塊maven-soapUI項目問題

兒童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> 
+0

代碼?什麼?你會怎麼猜測你的問題?如果你問到你問的同一個問題怎麼辦? – ant

+0

我問了一個類似的問題,從來沒有真正得到好的答案。我做的一點研究是在這裏http://stackoverflow.com/questions/9184862/soapui-maven-plugin-executing-multiple-projects –

+0

你是對的,maven插件我認爲仍然不支持它理想應該的許多功能,反正謝謝! – gresdiplitude

回答

1

中修復了這個孩子的pom.xml的微小變化。從

<projectFile>submodule.xml</projectFile> 

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

更改項目文件路徑萬一有人來這裏尋找類似的東西的解決方案......