1 回答

TA貢獻1829條經驗 獲得超4個贊
我的 maven 構建有同樣的錯誤“無效標志:-h 目標/標頭”。
我嘗試了上面 Gyro Gearless 的建議。我將原來的“-h 目標/標題”分成“-h”和“目標/標題”。那解決了我的問題。現在我項目中的所有 jni 標題都正確生成并放置在目標/標題中。
這是我的 pom.xml 中的整個編譯器插件配置部分:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<compilerArgs>
<arg>-h</arg>
<arg>target/headers</arg>
</compilerArgs>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
使用這個 pom,命令 'mvn compile' 足以生成 JNI 頭文件。請注意,'mvn clean'不會刪除以前生成的標題。
添加回答
舉報