Fork me on GitHub

Introduction

Native Maven Plugin

Use this plugin to compile c and c++ source under Maven 2 with
compilers such as gcc, msvc, gcj etc …

Usage

Instructions on how to use the Native Maven Plugin can be found on the usage page.

Goals Overview

The following contains summaries of all main goals. They work together in custom build lifecycle.

  • native:initialize: Initialize build lifecycle

  • native:unzipinc: Unpack dependencies with .inczip type to be included in include path at compile time

  • native:compile: Compile source files into native object files

  • native:inczip: Bundle header files to be installed/deployed

  • native:link: Link all previously built object and dependent library files into final build artifact

  • native:javah: Generate JNI include files based on a set of class names. Deprecated, and removed in the next major version: the javah tool does not exist in Java 10 and later. Set headerOutputDirectory of the maven-compiler-plugin (the -h option of javac) instead.

  • native:ranlib: ranlib a Unix linker output file

  • native:resource-compile: Compile Windows resource files

  • native:compile-message: Compile Windows message files

  • native:manifest: Build native manifest ( msvc only )

Examples