<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<compilerArgs>
<arg>-verbose</arg>
<arg>-h .</arg>
</compilerArgs>
</configuration>
</plugin>
But when I run mvn install I get this
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.936 s
[INFO] Finished at: 2018-11-07T14:52:49+05:30
[INFO] Final Memory: 9M/155M
[INFO]------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project adiesha-native: Fatal error compiling: invalid flag: -h . -> [Help 1]
Is there any other way to do this with maven or do i have to manually create them using "javac -h dir"
Any help would be greatly appreciated
–
–
–
–
I was have the same error "invalid flag: -h target/headers" with my maven build.
I tried the suggestion from Gyro Gearless above. I separated my original '-h target/headers' into '-h and 'target/headers'. That resolved my issue. Now all jni headers within my project are generated correctly and placed within target/headers.
Here is the entire compiler plugin config section from my 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>
With this pom, the command 'mvn compile' was enough to generate JNI headers. Note that 'mvn clean' will not remove previously generated headers.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.