Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 57981 invoked from network); 30 Jun 2010 17:03:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Jun 2010 17:03:59 -0000 Received: (qmail 94673 invoked by uid 500); 30 Jun 2010 17:03:56 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 94562 invoked by uid 500); 30 Jun 2010 17:03:56 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 97460 invoked by uid 99); 30 Jun 2010 15:58:11 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) MIME-Version: 1.0 Sender: scode@scode.org X-Originating-IP: [194.236.60.91] Date: Wed, 30 Jun 2010 17:56:40 +0200 X-Google-Sender-Auth: Omhol2GdvGB-U80OAs_caWjZrJM Message-ID: Subject: maven-nar-plugin library loading - how to make use of native libraries opaque From: Peter Schuller To: users@maven.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hello, I'm not sure I understand the intended usage of maven-nar-plugin, and after diving around in the source I'm not very much wiser. Given: * project C (junixsocket in this case) using maven-nar-plugin to build and deploy jar and nar artifacts * project B, depending on C * project A, depending on B I now want to simply declare that project A depends on B, and not have to worry about anything else. For example, I still want to be able to "java -jar XXX.jar" on an uber-jar produced by the maven-shade-plugin (or assembly, onejar, etc). I am aware that there are difficulties resulting from the fact that loadLibrary() cannot load an arbitrary library from a .jar file, and I'm aware that e.g. jna-posix solves this by unpacking to a temporary directory and loading the library by absolute path. With nar-plugin, once problem was that I never was able to make project A actually depend on the artifact (with the appropriate platform classifier) other than specifically configuring such a runtime dependency myself in the pom file. The second problem is that just making it depend on it won't solve the problem since somewhere, some code has to exist which jumps through hoops to enable the loading of the native library during runtime since putting the .nar file on the CLASSPATH won't make loadLibrary() be able to load the library. I was unable to find any code that seemed to do this in the nar-plugin, but perhaps I am missing it. Based on browsing the source, my current belief is that maven-nar-plugin is not really intended to address this use-case. Is that understanding correct, or am I just using it incorrectly? If nar-plugin is not suitable, does anyone have a suggestion as to a pre-existing plugin or other solution that is idiomatic/recommended within the Maven community? Additionally, if my understanding is correct, I do wonder what people normally do - i.e., what is the expected usage of nar-plugin in terms of running a built application (as opposed to developing a project with maven)? Thanks! -- / Peter Schuller --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org