jhsuwm / onejar-maven-plugin

Automatically exported from code.google.com/p/onejar-maven-plugin
0 stars 0 forks source link

using different native libs for different os not working #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In case of using different native libraries for different operating systems 
or architecures, one-jar is expecting subfolders in its binlib folder (e.g. 
binlib/linux32, binlib/linux64, binlib/macosx, ...). This is not working with 
the onejar-maven-plugin.

What is the expected output? What do you see instead?
I expected to see these subfolders in binlib folder of jar-file, but i don't 
see any subfolders at all.

What version of onejar-maven-plugin are you using?
1.4.2

What is the output of "mvn -version" on your machine?
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: de_DE, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac"

Please provide any additional information below.

Original issue reported on code.google.com by nrohwed...@gmx.de on 18 Aug 2010 at 3:07

GoogleCodeExporter commented 9 years ago
I'll take a look at this one.  Also, It's time to roll out a new plugin since 
One-JAR 0.97 is stable and released, so this might be a good driver for that.

Original comment by simontu...@gmail.com on 23 Aug 2010 at 2:58

GoogleCodeExporter commented 9 years ago
Simon, is this in the scope of OneJAR or onejar-maven-plugin? (I don't remember 
the inner details...) If it's for OneJAR, was it included in the 0.97 release?

Original comment by hugo.josefson.old@gmail.com on 6 Oct 2010 at 8:45

GoogleCodeExporter commented 9 years ago
as far as I'm aware this is a one-jar-maven plugin issue.  When I said I'd take 
a look I was indicating that this issue would be a good way for me to come up 
to speed developing the one-jar-maven plugin.  Naturally since then my life has 
become extremely busy and I haven't had chance.  One-JAR does support the 
architecture specific blinlib directories, let me review the code and be more 
specific tomorrow.

Simon.

Original comment by simontu...@gmail.com on 7 Oct 2010 at 3:38

GoogleCodeExporter commented 9 years ago
I'll mark this as Accepted then. Thanks.

Original comment by hugo.josefson.old@gmail.com on 7 Oct 2010 at 3:53

GoogleCodeExporter commented 9 years ago
Please also note the related bug/feature request for OneJar in 
http://sourceforge.net/tracker/?func=detail&aid=3053100&group_id=111153&atid=658
457 and the related discussion in 
https://sourceforge.net/projects/one-jar/forums/forum/380843/topic/1906599. 
Would be nice if the onejar-maven-plugin would support definining the libs for 
the pattern binlib/${os.name}/${os.arch} with arbitrary values in the pom so 
that implementation must not be changed in the future.

Original comment by bimsc...@gmail.com on 28 Feb 2011 at 10:21

GoogleCodeExporter commented 9 years ago
Hi Simon, because of using the arch- and os-specific native libs in our 
project, i just made a small patch in addition to use the support in pattern of 
"binlib/${os.name}/${os.arch}". The idea is, to add <os> and <arch> tags in the 
pom for each binlib. You can see our implementation on the attached files. The 
adaption in the JarClassLoader of the one-jar-plugin would be just a small 
patch of "findLibrary(String name) - method" of Sebastian Just and would 
propably look like:

     protected String findLibrary(String name) { 
         final String os = System.getProperty("os.name").toLowerCase(); 
         final String arch = System.getProperty("os.arch").toLowerCase(); 

         String binlib = BINLIB_PREFIX + os + "/" + arch + "/";

         VERBOSE("Using arch-specific native library path: " + binlib); 

         String retValue = findTheLibrary(binlib, name); 
         if (retValue != null) { 
             VERBOSE("Found in arch-specific directory!"); 
             return retValue; 
         } else { 
             VERBOSE("Search in standard native directory!"); 
             return findTheLibrary(BINLIB_PREFIX, name); 
         } 
     } 

nils

Original comment by nrohwed...@gmx.de on 2 Mar 2011 at 3:27

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Nils:

thank you for working this out, I will integrate this code when I make
a new version of one-jar.

Original comment by simontu...@gmail.com on 2 Mar 2011 at 4:40

GoogleCodeExporter commented 9 years ago
Hi Simon! First of all, wonderful solution! ... I was looking for something 
like this! :)

However, I had the same problem here using the 1.4.4 version of one-jar-maven 
plugin... I'm trying to use different native libs for mac/windows/linux, and I 
realized that all of them are generated in binlib. :/

Is this feature going to be available on next version of the plugin? 
Thank you very much! 

Keila

Original comment by keiko.ma...@gmail.com on 22 Oct 2012 at 9:26