This goal will compile the native test source code (c, c++ or fortran) and create executables from it. This flag can be used if you want to distribute a library that only contains pure abstract classes in include files. TBD If you set to true the compilation step will be skipped. The location of the runtime can be overridden in ntimeDirectory.Īll include files from COMPILER.includePaths are copied to be included in the noarch nar file. the java virtual machine if you set java.link to true.the libraries of any of the nar type dependencies.Using nar dependencies is preferred though. the list of libraries set in linker.libs.The static or dynamic library is linked against: any system directories set in COMPILER.sysincludepath, where COMPILER is c, cpp or fortran.the header files of any of the nar type dependencies, unless it is a jni library.otherwise the property from the AOL properties.if java.include is true or if javah.jniDirectory exists we add one of the following, relative to the java home directory:.any directories set in COMPILER.includePaths, where COMPILER is c, cpp or fortran.
Include paths are added in this order from:
The nar plugin will automatically select the correct compiler (c, c++ or fortran) based on the type of source, as specified in the patterns in AOL.c.includes, and, where AOL is a dotted qualifier of the architecture, os and linker ( for example). The standard way to separate your sources for different languages would be src/main/c, src/main/c++ and src/main/fortran, but any file under src/main is searched for. The NAR plugin searches the directory structure under COMPILER.sourceDirectory, which defaults to src/main. Most of the settings for cpptasks, such as compiler, linker, options and include dirs are available through the NAR plugin, see configuration. To handle the variety of compilers and linkers, the NAR plugin uses a derivative of the cpptasks from the ant-contrib project, with some minor improvements and additions of compilers. You can also produce a jni or a static library by setting library.type.
This goal will compile the native source code (c, c++ or fortran) and archive it into a shared library. Now that the linker name is known all other properties are looked up with a prefix of ]] from the AOL Properties file, but can be overridden in the configuration section (which can be made AOL specific by putting it inside a profile). The name of the linker is looked up in an architecture-os specific way, but can be overridden by setting linker.name (this means the subtag of the tag in the configuration section). Both can be overridden by setting os and arch in the configuration. The NAR Plugin tries to deduce the "Operating System" and the "Architecture" of the machine. The default settings come from the AOL properties file which allows us to specify different defaults depending on the architecture-os-linker combination, see AOL Properties. The configuration section of the NAR plugin allows one to override most of the default settings. The NAR Plugin starts off by setting and deducing all kinds of property values for usage in the goals below. The list below shows the sequence of the NAR goals: Using nar packaging allows you to build a jar file as well as nar files. The goals are part of the nar packaging/ lifecycle, which inserts the nar goals into the standard lifecyle. The NAR plugin executes the following goals, in the order below, to create and deploy nar files. Nar files get downloaded, unpacked and installed in the local maven repository, just like jar files are (apart from the unpacking). Other maven projects may specify dependencies on these nar files using the standard maven dependency declaration.
These nar files can be installed in the local maven repository and deployed to a standard maven (web) server, using the standard maven-install-plugin and maven-deploy-plugin. ) The output produced is wrapped up in Native ARchive files (.nar) some of which are machine independent (-noarch), while others are machine specific and thus depend on a combination of machine architecture(A), operating-system(O) and linker(L) identified as AOL. ) and with a number of different compilers/linkers (g++, Microsoft Visual C++, CC. This plugin for Maven 2 allows you to compile native code (c++, c and fortran) on a number of different architectures (Linux, Windows, MacOSX, Solaris.