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
1
vote
1 answer

Maven nar plugin: nar file not in classpath of dependent project

I have a JNI shared library written in C and the corresponding Java class in one maven project, and an application using that class in another project. I use the nar-maven-plugin for handling the JNI. Versions: Maven 3.6.0 Java 12 nar plugin 3.6.0 I…
Karsten Spang
  • 161
  • 2
  • 10
1
vote
1 answer

Linking with a DLL on Windows Using Maven NAR Plugin

I am trying to build a very simple C++ program using the Maven NAR plugin. I've set up a Maven module for building a shared library, and another for linking in the library and building an executable that uses it. Building on a Mac works great and I…
SingleShot
  • 18,821
  • 13
  • 71
  • 101
1
vote
2 answers

Maven custom file structure

I want to create a specific custom file structure for developping and I want to know if it could be done with maven. It is important to mention that i am using c++ for programming language and the Maven-nar-plugin I want to be able run a command…
1
vote
1 answer

How to run nar file from command line?

I used Eclipse and built a JNI project on my development machine using the nar-maven plugin. That compiles on multiple architectures and leaves me with .nar files. My problem is that now I want to run the main program in one of the Java classes in…
Brick
  • 3,998
  • 8
  • 27
  • 47
1
vote
1 answer

Native code for JUnit tests not compiled with `nar-maven-plugin`

I have a JNI project configured with Maven using the nar-maven-plugin. Both the Java and the C++ code reside in the project. The main code apparently compiles properly (both C++ and Java). The problem is with the test code (JUnit). The test code…
Brick
  • 3,998
  • 8
  • 27
  • 47
1
vote
2 answers

Avoiding machine-dependent POM with MinGW compiler and nar-maven-plugin

I have a simple JNI-based project up to experiment with the nar-maven-plugin. I'm running Windows 10 and am using MinGW compilers. I'm compiling the native code as C++ rather than C, although I don't think that matters for this question. (The native…
Brick
  • 3,998
  • 8
  • 27
  • 47
1
vote
1 answer

Why is compiler option /MD added when compiling static library with nar-maven?

When setting library.type to static, and running mvn -X clean compile, the DEBUG output shows: [DEBUG] Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl' with arguments: '' '/c' …
E9BF
  • 21
  • 7
1
vote
0 answers

Specify visual studio version in nar-maven-plugin

I have multiple versions of Visual Studio installed. Is there a way to specify which version of visual studio to use? Also, what if I want to generate NARs for multiple versions of Visual Studio, can the NAR plugin handle this? Ideally, the end…
1
vote
1 answer

separately publish maven attachments

I'm building NARs on multiple platforms (Mac and Windows). The build is complicated and can't be done via the Maven NAR plugin as such, but I'm building the nar files myself and using the mvn command-line tool for deployment. The typical way to do…
paleozogt
  • 6,393
  • 11
  • 51
  • 94
1
vote
1 answer

Maven NAR plugin: DLL dependency not found on path

I'm trying to build and test a DLL using Maven and the NAR plugin. The DLL I'm building depends on another DLL, which I built also using the NAR plugin. Here's my POM: 4.0.0
micro314
  • 21
  • 3
0
votes
0 answers

Add dependency of external jar to a NAR file

I have following project structure nifi-basename-bundle ├── nifi-basename-nar │ └── pom.xml ├── nifi-basename-processors │ ├── pom.xml | ├── libs | | └── xyz.jar │ └── src │ ├── main …
user1144004
  • 183
  • 3
  • 4
  • 21
0
votes
1 answer

how to generate cpp binaries using maven-nar plugin

I need help with compiling a c++ code using maven-nar plugin.I tried reading through the documentation but could not get the code working. Any help is greatly appreciated http://maven.apache.org/xsd/maven-4.0.0.xsd"> …
wandermonk
  • 6,856
  • 6
  • 43
  • 93
0
votes
1 answer

Maven NAR plugin + Spring boot in webapp, loading .nar artifact in Tomcat

I've managed to add platform dependencies to war and generated by maven-nar-plugin jni artifact into WEB-INF/lib/. But the problem is: added artifact has .nar extension while WebappClassLoaderBase adds only .jars to its internal class repositories,…
Pavlus
  • 1,651
  • 1
  • 13
  • 24
0
votes
3 answers

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories. while using in STS

I am able to create Spring Boot Starter Project and Maven Web Project from the STS, but somehow unable to create the maven-archetype-quickstart project in eclipse, its giving me below error In my project, I am using cacert file and custom…
Jeff Cook
  • 7,956
  • 36
  • 115
  • 186
0
votes
2 answers

Building C/C++ Maven NAR project from CLion terminal using Visual C++ compiler (msvc): Cannot deduce version number

I have a very simple C++ Maven NAR project and I want to compile it from CLion's terminal. This is my project's pom.xml:
lmiguelmh
  • 3,074
  • 1
  • 37
  • 53