You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Haim Ashkenazi <ha...@gmail.com> on 2008/06/05 12:57:07 UTC

Need advice about adding native dependencies

Hi

I'm creating a project that uses qtjambi (QT's java binding -
http://trolltech.com/products/qt/features/language-support/java). It
has both jar files and native libraries (statically compiled - seems
to be working fine at least on a few linuxes I've tried). In their
deployment documentation they recommend adding the native libraries to
the jar (top level) plus a descriptor file. Also you may not need all
the native libraries in your application (total of 37MB for linux32).
you may only need a few of them.

I have a few options here and I need you advice:

Option 1: Create an ANT script that downloads the binary zip/tar.gz
file, creates a customized jar (optimized for my project) and deploys
it to my local repository. Since this is a customize jar I need to
give it a unique groupId (i.e. not "com.trolltech.qtjambi") because
otherwise if I'll have another project that used qtjambi with
different settings it'll overwrite it.

Option 2: Create a custom jar like above but put it somewhere in the
system and use a "system" dependency.

Option 3: (I'm not sure if it's even technically possible) deploy the
original qtjambi.jar (without native libraries) to my archiva server
and also deploy the native libs as files into the server and somehow
declare each native library as a dependency . If it's possible, I
guess this would be my favorite option.

Option 4: Create a full jar with the native libs inside or in a
separate jar, deploy it (either on a server, or locally by script) and
hand-pick the parts I need manually in the packaging stage.

Is there a "correct" way to do it?

thanx
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Need advice about adding native dependencies

Posted by Haim Ashkenazi <ha...@gmail.com>.
On Mon, Jun 9, 2008 at 11:18 AM, Charlier, Etienne
<et...@siemens.com> wrote:
>
>
>>Yup, The more I think about it, I guess that I should create a full
>>native jar for each architecture, a java jar and hand-pick them in the
>>packaging process.
> As of Qt-jambi 4.4 the natives jar are already there..
>
> For Qt-jambi 4.3 I wrote a small shell script to create those jars.
> It's not on my work pc but I can try to find it back...
Thanks, I've already created an ant script that does that (If any one
is interested drop me an email).

Bye
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Need advice about adding native dependencies

Posted by "Charlier, Etienne" <et...@siemens.com>.
 

>Yup, The more I think about it, I guess that I should create a full
>native jar for each architecture, a java jar and hand-pick them in the
>packaging process.
As of Qt-jambi 4.4 the natives jar are already there..

For Qt-jambi 4.3 I wrote a small shell script to create those jars.
It's not on my work pc but I can try to find it back...



>BTW, IIRC anyone can submit jars to ibiblio, so maybe I'll send
>Trolltech an email and see if there's a legal reason why I can't
>submit these packages to ibiblio.

See
http://lists.trolltech.com/qt-jambi-interest/2008-01/msg00021.html#msg00
021




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Need advice about adding native dependencies

Posted by Haim Ashkenazi <ha...@gmail.com>.
On Thu, Jun 5, 2008 at 4:23 PM, Charlier, Etienne
<et...@siemens.com> wrote:
> Hi,
>
> for qt 4.4 one native jar is +/- 17MB ...
>
> I think you'd better ask the jambi mailing list as the possibility to
> create reduced native jar
> according to the application needs is jambi specific and not maven ....
Yup, The more I think about it, I guess that I should create a full
native jar for each architecture, a java jar and hand-pick them in the
packaging process.

BTW, IIRC anyone can submit jars to ibiblio, so maybe I'll send
Trolltech an email and see if there's a legal reason why I can't
submit these packages to ibiblio.

Bye
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Need advice about adding native dependencies

Posted by "Charlier, Etienne" <et...@siemens.com>.
Hi,

for qt 4.4 one native jar is +/- 17MB ...

I think you'd better ask the jambi mailing list as the possibility to
create reduced native jar
according to the application needs is jambi specific and not maven ....
cheers,
Etienne

PS: I'll try to make splitted jars when my other todos are solved ;-)

 

-----Original Message-----
From: Haim Ashkenazi [mailto:haim.ashkenazi@gmail.com] 
Sent: jeudi 5 juin 2008 14:57
To: Maven Users List
Subject: Re: Need advice about adding native dependencies

Hi

On Thu, Jun 5, 2008 at 3:14 PM, Charlier, Etienne
<et...@siemens.com> wrote:
> Hello,
>
> I'm busy right now trying to implement Option 3. based on jambi 4.4
> preview (they now distribute platform specific jars containing the
> native code)
>
> - I wrote a shell script that
>  - downloads the jambi jar ( linux 32, linux 64, win 32 for now)
>  - unpack them
>  - deploy the java jar to my local nexus repository ( using fake
groupid
> ech.trolltech)
>     groupId = ech.trolltech
>     artifactId = qtjambi
>     version = 4.4.0_01
>  - deploy the natives jar with
>     groupId = ech.trolltech
>     artifactId = qtjambi-native
>     classifier = linux32-gcc | linux64-gcc | win32-msvc2005
>     version = 4.4.0_01
>  - I also created a qtjambi-deps pom project having depedencies
>   - qt-jambi
>   - qt-jambi-natives
>   I used profiles activated using the <os> </os> stance to compute the
> actual classifier based on the running platform...
>
> Now, creating a project depending on qt-jambi-deps should bring in the
> correct native jar
Actually you're not using option 3 :).
 You're importing all your native libraries into the project (which
for linux32 is 37mb). Although I didn't try it yet, You should be able
to import only some of them If you don't reference them in your code.
I just don't want the size of the small utility I'm writing to be 40mb
because of unneeded libraries.

In option 3 I've meant to install each library on it's own as a
libXXX.so file (which is probably impossible).

Thanks for your answer anyway. I'll probably use your idea of a script
to install a jar with all native libs locally and then hand-pick them
in the packaging stage (option 4).

Bye
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Need advice about adding native dependencies

Posted by Haim Ashkenazi <ha...@gmail.com>.
Hi

On Thu, Jun 5, 2008 at 3:14 PM, Charlier, Etienne
<et...@siemens.com> wrote:
> Hello,
>
> I'm busy right now trying to implement Option 3. based on jambi 4.4
> preview (they now distribute platform specific jars containing the
> native code)
>
> - I wrote a shell script that
>  - downloads the jambi jar ( linux 32, linux 64, win 32 for now)
>  - unpack them
>  - deploy the java jar to my local nexus repository ( using fake groupid
> ech.trolltech)
>     groupId = ech.trolltech
>     artifactId = qtjambi
>     version = 4.4.0_01
>  - deploy the natives jar with
>     groupId = ech.trolltech
>     artifactId = qtjambi-native
>     classifier = linux32-gcc | linux64-gcc | win32-msvc2005
>     version = 4.4.0_01
>  - I also created a qtjambi-deps pom project having depedencies
>   - qt-jambi
>   - qt-jambi-natives
>   I used profiles activated using the <os> </os> stance to compute the
> actual classifier based on the running platform...
>
> Now, creating a project depending on qt-jambi-deps should bring in the
> correct native jar
Actually you're not using option 3 :).
 You're importing all your native libraries into the project (which
for linux32 is 37mb). Although I didn't try it yet, You should be able
to import only some of them If you don't reference them in your code.
I just don't want the size of the small utility I'm writing to be 40mb
because of unneeded libraries.

In option 3 I've meant to install each library on it's own as a
libXXX.so file (which is probably impossible).

Thanks for your answer anyway. I'll probably use your idea of a script
to install a jar with all native libs locally and then hand-pick them
in the packaging stage (option 4).

Bye
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Need advice about adding native dependencies

Posted by "Charlier, Etienne" <et...@siemens.com>.
Hello,

I'm busy right now trying to implement Option 3. based on jambi 4.4
preview (they now distribute platform specific jars containing the
native code)

- I wrote a shell script that
 - downloads the jambi jar ( linux 32, linux 64, win 32 for now)
 - unpack them
 - deploy the java jar to my local nexus repository ( using fake groupid
ech.trolltech)
     groupId = ech.trolltech
     artifactId = qtjambi
     version = 4.4.0_01
 - deploy the natives jar with 
     groupId = ech.trolltech
     artifactId = qtjambi-native
     classifier = linux32-gcc | linux64-gcc | win32-msvc2005 
     version = 4.4.0_01
 - I also created a qtjambi-deps pom project having depedencies 
   - qt-jambi
   - qt-jambi-natives
   I used profiles activated using the <os> </os> stance to compute the
actual classifier based on the running platform...

Now, creating a project depending on qt-jambi-deps should bring in the
correct native jar


TODO: 
 - check all this by creating a small hello world program with qt-jambi
 - use the assembly plugin to create platform specifics
jar-with-dependencies for deployement on user's computers

BTW, I already touched that topic on the jambi mailing list asking for a
maven repository managed by trolltech hosting those artifacts...
without much success  ( licensing issues ...)

Cheers
Etienne



-----Original Message-----
From: Haim Ashkenazi [mailto:haim.ashkenazi@gmail.com] 
Sent: jeudi 5 juin 2008 12:57
To: Maven Users List
Subject: Need advice about adding native dependencies

Hi

I'm creating a project that uses qtjambi (QT's java binding -
http://trolltech.com/products/qt/features/language-support/java). It
has both jar files and native libraries (statically compiled - seems
to be working fine at least on a few linuxes I've tried). In their
deployment documentation they recommend adding the native libraries to
the jar (top level) plus a descriptor file. Also you may not need all
the native libraries in your application (total of 37MB for linux32).
you may only need a few of them.

I have a few options here and I need you advice:

Option 1: Create an ANT script that downloads the binary zip/tar.gz
file, creates a customized jar (optimized for my project) and deploys
it to my local repository. Since this is a customize jar I need to
give it a unique groupId (i.e. not "com.trolltech.qtjambi") because
otherwise if I'll have another project that used qtjambi with
different settings it'll overwrite it.

Option 2: Create a custom jar like above but put it somewhere in the
system and use a "system" dependency.

Option 3: (I'm not sure if it's even technically possible) deploy the
original qtjambi.jar (without native libraries) to my archiva server
and also deploy the native libs as files into the server and somehow
declare each native library as a dependency . If it's possible, I
guess this would be my favorite option.

Option 4: Create a full jar with the native libs inside or in a
separate jar, deploy it (either on a server, or locally by script) and
hand-pick the parts I need manually in the packaging stage.

Is there a "correct" way to do it?

thanx
-- 
Haim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org