2016-08-30 17 views
0

Maven execプラグインを使用してJavaツールjavahを実行する際に問題が発生します。私は、ヘッダファイルが配置されるが、私はエラーを取得javahに出力ディレクトリを指定しようとしています:Maven execプラグインを使用して実行するとjavahが失敗する

[INFO] --- exec-maven-plugin:1.5.0:exec (create-jni-headers) @ jni-test-osgi --- Error: unknown option: -d /home/kerry [ERROR] Command execution failed.

これは、POMの関連セクションです:私はjavah -d /home/kerry com.javatechnics.jni.test.osgi.HelloWorldを実行した場合

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>exec-maven-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>create-jni-headers</id> 
      <goals> 
       <goal>exec</goal> 
      </goals> 
      <phase>compile</phase> 
      <configuration> 
       <executable>javah</executable> 
       <workingDirectory>${project.build.outputDirectory}</workingDirectory> 
       <arguments> 
        <argument>-d /home/kerry</argument> 
        <argument>com.javatechnics.jni.test.osgi.HelloWorld</argument> 
       </arguments> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

コマンドラインから問題がありません。

私は何か間違っているか、Maven execプラグインに問題がありますか?

答えて

0

各「引数」は、独自のライン持っている必要があります。

<argument>-d</argument> 
<argument>/home/kerry</argument> 
<argument>com.javatechnics.jni.test.osgi.HelloWorld</argument> 

をそれ以外の場合は「-d /ホーム/ケリーは」にとっては未知である単一の引数である

として
javah "-d /home/kerry" com.javatechnics.jni.test.osgi.HelloWorld 

伝わってきますjavahコマンドしたがって、エラー。

+0

私はそれを試みたと思ったが、明らかにそうではなかった!どうもありがとう。 – Kerry

関連する問題