【发布时间】:2017-01-07 03:14:29
【问题描述】:
我在使用 Maven exec 插件执行 Java 工具 javah 时遇到问题。我正在尝试将输出目录指定为 javah 要放置头文件的位置,但出现错误:
[INFO] --- exec-maven-plugin:1.5.0:exec (create-jni-headers) @ jni-test-osgi --- 错误:未知选项:-d /home/kerry [错误] 命令执行失败。
这是 POM 的相关部分:
<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>
如果我从命令行执行javah -d /home/kerry com.javatechnics.jni.test.osgi.HelloWorld 则没有问题。
是我做错了什么还是 Maven exec 插件有问题?
【问题讨论】:
标签: java maven exec-maven-plugin