3 ms·
How does Maven handle JNI? Is it also a build system for C/C++, or do packages with native bindings require manual build steps?
by panzi 5mo ago
How does Maven handle JNI? Is it also a build system for C/C++, or do packages with native bindings require manual build steps?
- panzi 5mo agoI googled a bit and found this snippet: <plugin> <artifactId>exec-maven-plugin</artifactId> <version>3.5.1</version> <groupId>org.codehaus.mojo</groupId> <executions> <execution> <id>Generate-shared-lib</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>bash</executable> <arguments> <argument>generate-lib.sh</argument> </arguments> <environmentVariables> <JAVA_HOME>${env.JAVA_HOME}</JAVA_HOME> </environmentVariables> </configuration> </execution> </executions> </plugin> At least with certain plug-ins Maven will execute arbitrary commands at build time. And if you need that to build native bindings it feels like a big hole. Granted, most projects don't need JNI, I guess.