2017-04-11 8 views
0

こんにちは私はJenkinsを新しくしています。私は選択パラメータプラグインを使用して、ユーザーが実行したいスイートを選択できるようにしています。私が抱えている問題は、ディレクトリを追加するためにパラメータセクションで選択したオプションを変更しようとするときです。パラメータにフルネームを入れ、ビルドデータとして直接入力するとうまく動作します。以下は私のジェンキンセットアップ、ポンとエラーです。すべてのヘルプは非常にJenkins Maven Projectバイラルシェルが利用できません

選択パラメータデータ

Name choice 
Choices CopyFunctionality 
     CopyToFunctionality 

ウィンドウバッチシェルコマンド

@echo off 

set SUITE=%choice%.xml 

echo %SUITE% 

ビルドが

clean test -PParameterisedBuild -DsuiteXmlFile=${SUITE} 
値いただければ幸いです

POMプロファイル

<profile> 
      <id>ParameterisedBuild</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-surefire-plugin</artifactId> 
         <version>2.19.1</version> 
         <configuration> 
          <suiteXmlFiles> 
           <suiteXmlFile>testNG XML Files\${SUITE}</suiteXmlFile> 
          </suiteXmlFiles> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

Mavenのエラー

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project Expert_Models: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process 
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: Suite file C:\Automation Framework\Jenkins\workspace\regression_tests_selectable\testNG XML Files\${SUITE} is not a valid file 
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(TestNGXmlTestSuite.java:98) 
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[JENKINS] Archiving C:\Automation Framework\Jenkins\workspace\regression_tests_selectable\pom.xml to com.ExpertModels/Expert_Models/0.1-SNAPSHOT/Expert_Models-0.1-SNAPSHOT.pom 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 
channel stopped 
Finished: FAILURE 

答えて

0
  1. POMからsuiteXmlFilesのPARAMを除外し、お使いのシステムのparamsは、それを上書きしますので、このPARAMを持っている必要はありません。
  2. バッチスクリプトを使ってジェンキンパラメータを設定する必要はありません。ジェンキンスはパラメータを解析します。
  3. 峠スイートのparamsのような確実なプラグインをMavenのために:

    クリーンテスト-PParameterisedBuild -Dsurefire.suiteXmlFile = $ {選択(またはものは何でもお好みのPARAMの名前がある)}

P.S.また、上記の情報に基づいてプロフィールの使用方法を再評価することをお勧めします。私は99%のケースでは単にプロフィールを避けることができると確信しています。

関連する問題