2016-09-12 8 views
1

を失敗しましたコマンドの引数は、私が使用する必要がある引数も持っている別のコマンド(RMIC)です。渡す引数は、私はEJB 2.1</p> <p>事はの1つであるで作られた私の古いプロジェクトのためのejbdeployコマンドを起動するためのmaven-EXEC-プラグインを使用しようとしています

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>exec-maven-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>ejb-deploy</id> 
      <phase>package</phase> 
      <goals> 
       <goal>exec</goal> 
      </goals> 
      <configuration> 
       <executable>ejbdeploy</executable> 
        <arguments> 
         <argument>${project.build.directory}\${project.build.finalName}.jar</argument> 
         <argument>${project.build.directory}\working</argument> 
         <argument>${project.build.directory}\${project.build.finalName}-deployed.jar</argument> 
         <argument>-rmic "-d C:\java\classes"</argument> 
         <argument>-cp</argument> 
         <classpath/> 
        </arguments> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

このコードは、私のmvn clean install中にエラーが発生します。

[INFO] --- exec-maven-plugin:1.5.0:exec (ejb-deploy) @ SIMBOLight --- 
Unrecognized option: -rmic -d. 
Unrecognized option: C:\java\classes. 
Error: Must specify the input JAR/EAR filename, the working directory, and output JAR/EAR filename. 
0 Errors, 0 Warnings, 0 Informational Messages 

私は私のパラメータをmalformattingていますようにです。何か案は ?

答えて

1

exec-maven-pluginで引数を渡すときは、各<argument>にエスケープされていないスペース文字が含まれていないことを確認する必要があります。各引数は別々の<argument>として指定する必要があります。あなたのケースでは

は、-rmic "-d C:\java\classes"は実際に2つの引数で形成されている:最初のものは-rmicで、もう一つは(エスケープスペースを含む)"-d C:\java\classes"ですので、あなたは、単一の<argument>にそれらを渡すことはできません。このように

、次の構成持つことができます。これらの引数で構成されている場合

<arguments> 
    <argument>${project.build.directory}\${project.build.finalName}.jar</argument> 
    <argument>${project.build.directory}\working</argument> 
    <argument>${project.build.directory}\${project.build.finalName}-deployed.jar</argument> 
    <argument>-rmic</argument> 
    <argument>"-d C:\java\classes"</argument> 
    <argument>-cp</argument> 
    <classpath /> 
</arguments> 

は、立ち上げ実行可能ファイルのmainメソッドは、引数配列の3番目の要素として-rmicがかかりますし、そしてなど-d C:\java\classes引数配列の4番目の要素。

+0

実際、あなたは完全に正しいです。他にもいくつかのエラーがありますが、maven-exec-pluginの使用とは関係ありません。迅速かつ簡潔に、ありがとう! – MadJlzz

関連する問題

 関連する問題