2017-10-16 132 views
0

我正在做一個maven smartbear soapui項目。我有依賴兩個插件。 `多個maven插件運行階段

<build> 
    <plugins> 
     <plugin> 
     <groupId>com.smartbear.soapui</groupId> 
     <artifactId>soapui-pro-maven-plugin</artifactId> 
     <version>5.1.2</version> 
     <executions> 
      <execution> 
      <id>pro</id> 
      <phase>test</phase> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      <configuration> 
       <projectFile>${projectFile}</projectFile> 
       <outputFolder>${basedir}/target/surefire-reports</outputFolder> 
       <junitReport>true</junitReport> 
       <exportAll>true</exportAll> 
       <printReport>true</printReport> 
       <testFailIgnore>true</testFailIgnore> 
      </configuration> 
      </execution> 
     </executions> 
     <configuration> 
      <soapuiProperties> 
      <property> 
       <name>soapui.logroot</name> 
       <value>${project.build.directory}/surefire-reports/</value> 
      </property> 
      <property> 
       <name>soapui.https.protocols</name> 
       <value>TLSv1.2,SSLv3</value> 
      </property> 
      </soapuiProperties> 
     </configuration> 

     <dependencies> 
      <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      </dependency> 
      <dependency> 
      <groupId>org.reflections</groupId> 
      <artifactId>reflections</artifactId> 
      <version>0.9.9-RC1</version> 
      </dependency> 
      <dependency> 
      <groupId>org.reflections</groupId> 
      <artifactId>reflections</artifactId> 
      <version>0.9.9-RC1</version> 
      </dependency> 
      <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.19.1</version> 
      <type>maven-plugin</type> 
      </dependency> 
     </dependencies> 
     </plugin> 
     <plugin> 
     <groupId>com.github.redfish4ktc.soapui</groupId> 
     <artifactId>maven-soapui-extension-plugin</artifactId> 
     <version>4.6.4.2</version> 
     <executions> 
      <execution> 
      <id>redfish</id> 
      <phase>test</phase> 
      <configuration> 
       <testSuiteProperties> 
       <properties> 
        <property>PropertyCode=${propertyCode}</property> 
        <property>Environment=${environment}</property> 
        <Gateway>Gateway=${gateway}</Gateway> 
       </properties> 
       </testSuiteProperties> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build>` 

我的測試需要有依賴插件redfish,因爲它支持soapuiTestSuite屬性配置。

現在,當我試圖運行這個mvn install test時,構建開始運行第一個插件,並失敗,因爲它沒有下載第二個插件,然後再次運行下載第二個插件但失敗。在運行目標之前,我需要同時擁有插件和整個配置設置。

我是新來的Maven結構。

回答

0
  1. 在第二個插件添加執行。
  2. 例如,如果你想的soapUI-PRO-Maven的插件之前執行的maven-soapUI的擴展,插件,你可以添加此執行:

    <executions> 
           <execution> 
            <id>soapui-tests</id> 
            <phase>verify</phase> 
            <goals> 
            <goal>test</goal> 
            </goals> 
          </execution> 
         </executions> 
    
  3. 而只是 'MVN安裝',因爲你有執行連接到默認的Maven生命週期。

看看默認的Maven生命週期的執行順序列表:驗證,初始化..部署(docs here)。

+0

我的項目取決於兩個插件。根據你的陳述,只有一個插件會被正確執行? – ChanChow

+0

不,將每個插件附加到一個階段以掌握這些插件的執行順序 –

相關問題