2017-10-16 9 views
0

私はmaven smartbear soapuiプロジェクトをやっています。私は2つのプラグインに依存しています。 `フェーズを実行する複数の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>` 

私のテストでは、soapuiTestSuiteプロパティ設定をサポートするため、依存関係プラグインredfishが必要です。

mvn install testを実行しようとすると、最初のプラグインでビルドが開始され、2番目のプラグインがダウンロードされずに後でもう一度ダウンロードが実行されますが失敗して失敗します。私は、目標を実行する前に、プラグインと設定の両方を準備する必要があります。

私はMaven構造体に新しいです。

答えて

0
  1. 2番目のプラグインで実行を追加します。ので、

    <executions> 
           <execution> 
            <id>soapui-tests</id> 
            <phase>verify</phase> 
            <goals> 
            <goal>test</goal> 
            </goals> 
          </execution> 
         </executions> 
    
  2. そして、ちょうど 'MVNインストール' ん:たとえば、

  3. あなたはSOAPUI-プロのmaven-pluginの前のmaven-SOAPUI拡張-プラグインを実行したい場合は、この実行を追加することができますMavenのデフォルトのライフサイクルに実行が添付されています。実行順序のデフォルトのMavenライフサイクルのリストで

ルック:検証し、初期化し、...(docs here)を展開。

+0

私のプロジェクトは、両方のプラグインに依存しています。あなたの声明によれば、1つのプラグインだけが正しく実行されますか? – ChanChow

+0

いいえ、各プラグインをフェーズに接続して、これらのプラグインの実行順序をマスターします –

関連する問題