2016-08-30 13 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