Questions tagged [maven-nar-plugin]

The nar-maven-plugin (formerly "maven-nar-plugin") is a Maven plugin that provides a platform-agnostic way of managing native code dependencies of Java projects.

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, ...) and with a number of different compilers/linkers (g++, Microsoft Visual C++, CC, ...). 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. 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.

38 questions
21
votes
3 answers

Adding a JNI library to the local Maven Repository

I wish to add a JNI library, including its shared object (.so) file to my project using Maven. Unfortunately it is not yet on a public repository so I guess I have to install it myself on my local repository to have it working. How do I go about…
jbx
  • 21,365
  • 18
  • 90
  • 144
5
votes
3 answers

maven-nar-plugin vs native-maven-plugin, which is better?

I am going to create a java project that uses JNI. I want to deploy the project as a stand-alone application, but some modules might be used as libraries of other applications as well. I want to support different platforms and everything should be…
5
votes
2 answers

Nar dependency in multi-module maven project

I set up a multi module maven project, which is comprised of a module destined to build nar jni library, and a jar packaged module that is dependent on that library. I am able to install the nar library to my local maven repository, but I fail to…
libnull-dev
  • 881
  • 1
  • 7
  • 19
5
votes
1 answer

build C++ projects in Maven with maven-nar-plugin

has anyone using maven-nar-plugin to build C++ code for different platforms, using different compilers? If there is someone please give me more info regarding this. I am just wondering how can be a NAR file built for different platforms with maven.…
Asgard
  • 602
  • 1
  • 7
  • 18
4
votes
1 answer

Can't build C/C++ projects using maven-nar plugin

I'm trying to setup a simple project with an empty function (.c and .h file) on windows 7, using maven, cygwin and gcc. Following are details about my environment: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19…
Code Poet
  • 11,227
  • 19
  • 64
  • 97
3
votes
1 answer

GoogleTest compilation error in Maven nar build - undefined reference to `testing::internal::MakeAndRegisterTestInfo

I am trying to experiment with Google test with Maven. So, I installed it using this link. I then created dummyTest.cpp for testing and added it in pom.xml to execute the test. While I do mvn clean install, I am getting following error - [INFO] 1…
user109260
  • 878
  • 7
  • 22
3
votes
0 answers

Compile C to native library in Maven

I have a Java project that relies on C source files. I have the proper JNI header files, I just need to compile them with the C code to a dll (or Linux/OSX equivalent) in target/. My current pom.xml builds the Java code, but doesn't build the…
jado
  • 922
  • 9
  • 21
3
votes
0 answers

nar-maven-plugin - cross compile JNI for arm linux on amd64 linux

I would cross compile my JNI NAR project to arm linux. On this link, I read the recommendation for compiling on the native systems with help of Jenkins. But I need only compiling for linux and the architectures arm, x86 and AMD64. For this case the…
user3612610
  • 233
  • 4
  • 18
2
votes
1 answer

Using a native Maven artifact (nar) in a webapp

I have a native shared library that is built and packaged using the maven-nar plugin. This works great and builds on Linux/MacOSX/Windows. I've also defined a JNI library, also built using maven-nar, that wraps the shared library. Both of these are…
JerryF
  • 418
  • 6
  • 10
2
votes
1 answer

How do I add a NAR dependency to a maven pom file?

I'm trying to use JNI, and I'm using the maven-nar-plugin to package up the C++ code into a NAR. Now, I want to include this code in another Java project. How do I go about doing this properly?
gersh
  • 2,227
  • 4
  • 23
  • 23
2
votes
0 answers

How can I create multiple shared libraries with maven nar plugin?

How can I create multiple shared libraries with maven nar plugin? Here is a snippet from my pom.xml: com.github.maven-nar nar-maven-plugin 3.5.1
betontalpfa
  • 3,454
  • 1
  • 33
  • 65
2
votes
1 answer

How to add jnetpcap as dependency in maven project?

I have created app that uses jnetpcap. It should be multiplatform and runs on 32 and 64 platforms. I have never worked with maven befor, so how to add all versions of jnetpcap to project? I found a solution that uses nar…
Troir1
  • 63
  • 3
  • 9
2
votes
1 answer

Cross compile for ARM using Maven NAR Plugin

I am trying to build an C++ application for both x86/amd64 and ARM with the Maven NAR plugin on Debian/Ubuntu. I've troubles to set up a correct profile for the ARM cross-compile build with arm-linux-gnueabi-gcc. The profile snippet from my pom.xml…
Doc Brown
  • 422
  • 5
  • 9
2
votes
1 answer

Maven: In the nar-plugin, can you specify where to get the includes?

I have a project with multiple sub-modules and sub-sub-modules which has both java and native language code (Mostly native language). To process this native code, I use the maven-nar-plugin. Now, I don't have all the includes needed to compile the…
Rob Avery IV
  • 3,562
  • 10
  • 48
  • 72
1
vote
1 answer

Use NAR file as a maven dependency

I am pretty new with Apache Nifi and NARs in general. I am creating a custom processor NAR project which needs to reference classes from the jars present in another NAR file. I don't have access to the project(source code) which has generated this…
user1144004
  • 183
  • 3
  • 4
  • 21
1
2 3