Maven NAR Plugin Properties Mark Donszelmann

Below are the properties by group for the NAR plugin. The properties with the [arch.[os.[linker.]] prefix can either be set in general, architecture specific, architecture-os specific or architecture-os-linker specific. The latter overruling the former ones. The defaults for these combinations are listed in two separate tables below.

Flag Description
maven -Dverbose Output NAR debug statements
maven -X Output maven debug statements
Property Description Default Value
maven.nar.arch Architecture [arch] (ex: x86, i386, sparc, ...) ${os.arch}
maven.nar.os Operating System [os] (ex: Linux, win32, MacOSX, SunOs, ...) ${os.name} (Note: no spaces)
[arch.[os.]]maven.nar.linker Linker [linker] (ex: msvc, g++, CC, ...), but you may use any name here and override it in the property arch.os.linker.maven.nar.linker to the real linker name. Architecture-OS specific, see below.
Property Description Default Value
maven.nar.src Source file directory src/main/cpp
maven.nar.cpp.src.includes C++ file pattern to include **/*.h **/*.hh **/*.cc **/*.cpp **/*.cxx
maven.nar.cpp.src.excludes C++ file pattern to exclude
maven.nar.c.src.includes C file pattern to include **/*.h **/*.c
maven.nar.c.src.excludes C file pattern to exclude
maven.nar.fortran.src.includes Fortran file pattern to include **/*.f **/*.for
maven.nar.fortran.src.excludes Fortran file pattern to exclude
maven.nar.test.src Test source file directory src/test/cpp
maven.nar.compile.includepath Include path for compilation src/main/include
maven.nar.compile.sysincludepath System include path for compilation
maven.nar.compile.withjava Adds the Java Virtual Machine include files for compilation false (automatic if the nar:jni goal is run and headers are generated)
maven.nar.test.compile.includepath Include path for compilation of tests src/test/include
maven.nar.link.withjava Enables the linking with the Java Virtual Machine ${maven.nar.compile.withjava}
maven.nar.jni.classpath Classpath to add for nar:jni goal
maven.nar.tests List of test (executables) to be generated
maven.nar.includefilesonly Generates only common NAR file. Machine-OS specific NAR file will not be made. false
maven.nar.aol Architecture-OS-Linker [aol] name, used for naming the machine specific NAR and used for the destination directory arch-os-linker
maven.nar.dest Output directory ${maven.build.dir}/nar
maven.nar.test.dest Test output directory ${maven.build.dir}/test-nar
Property Description Default Value
[arch.[os.[linker.]maven.nar.cpp.compiler C++ Compiler Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.c.compiler C Compiler Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.fortran.compiler Fortran Compiler Architecture-OS-Linker specific, see below
arch.os.linker.maven.nar.linker Real linker name Architecture-OS-Linker specific, see below
Property Description Default Value
[arch.[os.[linker.]maven.nar.rtti Enable Runtime Type Identification true
[arch.[os.[linker.]maven.nar.exceptions Enable Exception Handling true
[arch.[os.[linker.]maven.nar.runtime Use static or dynamic runtime library dynamic
[arch.[os.[linker.]maven.nar.optmize Set optimization level none
[arch.[os.[linker.]maven.nar.multithreaded Enable multithreading false
[arch.[os.[linker.]maven.nar.incremental Enable incremental linking false
[arch.[os.[linker.]maven.nar.failonerror Abort if an error is detected true
[arch.[os.[linker.]maven.nar.libtool Use libtool to compile and link false
[arch.[os.[linker.]maven.nar.debug Generate debugging code false
[arch.[os.[linker.]maven.nar.outtype Type of library to be generated (use "jni" for native shareable code with java) static
[arch.[os.[linker.]maven.nar.test.outtype Type of test output to be generated executable
Property Description Default Value
[arch.[os.[linker.]maven.nar.compiler.arg.start|mid|end Space delimited list of optional compiler arguments. start|mid|end specifies the position in the compiler argument list.
[arch.[os.[linker.]maven.nar.cpp.compiler.arg.start|mid|end Space delimited list of optional cpp compiler arguments. start|mid|end specifies the position in the compiler argument list.
[arch.[os.[linker.]maven.nar.c.compiler.arg.start|mid|end Space delimited list of optional c compiler arguments. start|mid|end specifies the position in the compiler argument list.
[arch.[os.[linker.]maven.nar.fortran.compiler.arg.start|mid|end Space delimited list of optional fortran compiler arguments. start|mid|end specifies the position in the compiler argument list.
[arch.[os.[linker.]maven.nar.linker.arg.start|mid|end Space delimited list of optional linker arguments. start|mid|end specifies the position in the linker argument list.
[arch.[os.[linker.]maven.nar.linker.test.arg.start|mid|end Space delimited list of optional linker arguments for creating the test output. start|mid|end specifies the position in the linker argument list.
Property Description Default Value
[arch.[os.[linker.]maven.nar.java.home Java Home (jdk) ${java.home}/..
[arch.[os.[linker.]maven.nar.java.include Directory to look for include files for jni ${maven.nar.java.home}/include
[arch.[os.[linker.]maven.nar.java.include.os OS specific directory to look for include files for jni Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.java.vm Location to the jvm Architecture-OS-Linker specific, see below
Property Description Default Value
[arch.[os.[linker.]maven.nar.lib.prefix Prefix for library name Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.static.extension Extension for static library Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.shared.extension Extension for shared library Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.plugin.extension Extension for plugin library Architecture-OS-Linker specific, see below
[arch.[os.[linker.]maven.nar.executable.extension Extension for executable output Architecture-OS-Linker specific, see below
Property Description Default Value
maven.nar.libs.type Type for libraries static
maven.nar.libs List of library modules to link against [X]
maven.nar.lib.X.libs List of library names to link against X
maven.nar.lib.X.dir Directory where to look for X ${maven.nar.dest}/lib
maven.nar.lib.X.type Type of library X ${maven.nar.libs.type}
[arch.[os.[linker.]maven.nar.arch.includes Include these files and libraries in the arch specific nar file Architecture-OS-Linker specific, see below

Below are the defaults for the architecture and os specific properties. Each of the property names is prefixed with the arch.os name as given in the different columns.

Property x86.win32 i386.Linux amd64.Linux ppc.MacOSX sparc.SunOS
maven.nar.linker msvc g++ g++ g++ CC
maven.nar.java.home ${java.home}
maven.nar.java.include.os prefixed with maven.nar.java.home include/win32 include/linux include/linux include/solaris
maven.nar.java.vm prefixed with maven.nar.java.home lib jre/lib/i386/client jre/lib/amd64/server IGNORED, uses "-framework JavaVM" jre/lib/sparc/server
maven.nar.multithreaded true
maven.nar.cpp.compiler msvc g++ g++ g++ CC
maven.nar.c.compiler msvc gcc gcc gcc suncc
maven.nar.fortran.compiler df g77 g77 g77 sunf77
maven.nar.compiler.arg.start -DWIN32 -DLinux -DLinux -DDarwin -lpthread -DSOLARIS2
maven.nar.linker.arg.start -lpthread
maven.nar.arch.includes lib/**/*.lib lib/**/*.dll lib/**/*.a lib/**/*.so lib/**/*.a lib/**/*.so lib/**/*.a lib/**/*.so lib/**/*.dylib lib/**/*.jnilib lib/**/*.a lib/**/*.so
maven.nar.lib.prefix lib lib lib lib
maven.nar.static.extension .lib .a .a .a .a
maven.nar.shared.extension .dll .so .so .dylib .so
maven.nar.plugin.extension .dll .so .so .bundle .so
maven.nar.executable.extension .exe

Below are the defaults for the architecture, os and linker specific properties. Each of the property names is prefixed with the arch.os.linker name as given in the different columns.

Property x86.win32.g++ i386.Linux.icc i386.Linux.ecc
maven.nar.cpp.compiler g++ icpc ecpc
maven.nar.c.compiler gcc icc ecc
maven.nar.fortran.compiler g77 ifort ifort (should this be efc?)