Ticket #162 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Maven: research use of Maven with native libraries

Reported by: curtis Owned by: curtis
Priority: major Milestone: biweekly-2011: Apr-11 to Apr-22
Component: Build System Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Sometimes, a Java component will have one or more corresponding native libraries associated with it. In our case, we would like to migrate Rick's decon project to the Java repository under Maven, but it needs some native library integration to work properly.

See  this article for some details.

Change History

comment:1 Changed 9 years ago by curtis

  • Component changed from other to build

comment:2 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2010: Sep-07 to Sep-17 to biweekly-2010: Sep-20 to Oct-01

comment:3 Changed 9 years ago by aivar

Using Maven2 to build projects which use JNI code
Richard van der Hoff

The solution he wound up with is to put the native code in a jar file then he wrote an open-source custom loader that decompresses from the jar file into a temporary directory and does the loadLibrary.

 http://docs.codehaus.org/display/MAVENUSER/Projects+With+JNI

Maven code repository:

 http://opensource.mxtelecom.com/maven/repo/com/wapmx/native/mx-native-loader/1.2/

Here is the LICENSE file:

Copyright (c) 2008 MX Telecom

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

comment:4 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2010: Sep-20 to Oct-01 to biweekly-2010: Oct-04 to Oct-15

comment:5 Changed 9 years ago by curtis

It looks like the  FreeHEP Maven Native Archive Plugin has gotten very good since van der Hoff's article (he even says as much). It looks like we may not even need CMake at all to use it. Hopefully it is good enough to meet our use cases.

comment:6 Changed 9 years ago by curtis

Turns out that freehep-nar-plugin has been replaced by  maven-nar-plugin.

comment:7 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2010: Oct-04 to Oct-15 to biweekly-2010: Nov-01 to Nov-12

comment:8 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2010: Nov-15 to Nov-24 to biweekly-2010: Nov-29 to Dec-10

comment:9 Changed 9 years ago by curtis

  • Priority changed from minor to major

comment:10 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2011: Feb-14 to Feb-25 to biweekly-2011: Mar-14 to Mar-25

comment:11 Changed 9 years ago by curtis

  • Milestone changed from biweekly-2011: Mar-14 to Mar-25 to biweekly-2011: Mar-28 to Apr-08

comment:12 Changed 9 years ago by curtis

Aivar now has a source:trunk/extra/native-library-util project for handling native libraries. I need to better understand how to use Maven to build native code, whether the maven-nar-plugin will be useful for deployment (Aivar says no), and how he is currently using the maven-native-plugin.

comment:13 Changed 9 years ago by curtis

  • Status changed from new to closed
  • Resolution set to fixed

At this point Aivar has done a lot more research into this issue, and generally has the maven-nar-plugin working with SLIM-curve. I am closing this ticket for the time being, and will reopen if needed.

comment:14 Changed 9 years ago by curtis

See ticket #281 for further details on Aivar's work.

Note: See TracTickets for help on using tickets.