Note that there are some explanatory texts on larger screens.

plurals
  1. POLudicrous boilerplate in Maven native plugin
    primarykey
    data
    text
    <p>I'm currently rewriting my OSS project <a href="https://github.com/fommil/netlib-java/tree/master/native_ref" rel="nofollow">netlib-java</a> to be as easy to use as possible by both devs and end users.</p> <p>However, as part of the maven-native setup, I seem to need a separate <code>pom.xml</code> for each native binary that I want to create. The large majority of these files are actually identical across platforms.</p> <p><strong>How can I reduce the boilerplate of my native build files?</strong>, e.g.:</p> <ul> <li><a href="https://github.com/fommil/netlib-java/blob/master/native_ref/osx_64/pom.xml" rel="nofollow">osx_64/pom.xml</a></li> <li><a href="https://github.com/fommil/netlib-java/blob/master/native_ref/linux_64/pom.xml" rel="nofollow">linux_64/pom.xml</a></li> </ul> <p>(Almost everything is shared between OS targets, except the name of the output file, the compiler flags, and the target platform for javah).</p> <p>Some other smaller, but related, questions:</p> <ul> <li>I only want to distribute bundled jars, how can I turn off the <code>jnilib</code> (etc) deploys and instead deploy a <code>jar</code> using the default <code>classifier</code> (I can create a <code>native</code> classifier jar, but this is awkward for end users to include).</li> <li>Obviously I'll never be able to build the whole project in one go (as there are several OS native targets). However, Maven insists on trying to compile things if they are modules. How can I set up a dependency tree / workflow such that end users only need to depend on one project which pulls in all the native jars?</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload