You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by nicolas de loof <ni...@apache.org> on 2008/10/22 17:09:58 UTC

how to write a plugin that uses native (jni) dependencies ?

Hi,
I'd like to package a windows tool as a maven plugin. I can programmatically
run it via JNI (using COM automation) but I need to set the
java.library.path for this to work.

How can maven support such use case ?

Nicolas

Re: how to write a plugin that uses native (jni) dependencies ?

Posted by nicolas de loof <ni...@apache.org>.
Right,
NAR plugin forks a new JVM to test/integration-test a JNI lib, so it can set
the java.library.path

Wiki on JNI uses a custom tool to load all native libs found in project
classpath.

For a java+jni lib that does it's own System.loadLibrary( x ) on init, only
the fork option is possible AFAIK to configure the JVM library.path.



2008/10/25 Wayne Fay <wa...@gmail.com>

> Probably NMaven was a poor suggestion. You get what you paid for on that
> one.
>
> But FreeHEP NAR was not.
>
> Also check out this webpage on the Maven User wiki:
> http://docs.codehaus.org/display/MAVENUSER/Projects+With+JNI
>
> Wayne
>
> On Sat, Oct 25, 2008 at 6:33 AM, nicolas de loof <ni...@apache.org>
> wrote:
> > I made a grep-search on NMaven to search for "library.path" with no
> result.
> > How does NMaven (that runs .Net tools from Java) relate to setting
> > java.library.path on the JVM ?
> >
> > Nicolas
> >
> > 2008/10/23 Wayne Fay <wa...@gmail.com>
> >
> >> > I'd like to package a windows tool as a maven plugin. I can
> >> programmatically
> >> > run it via JNI (using COM automation) but I need to set the
> >> > java.library.path for this to work.
> >>
> >> I don't know the answer, but I assume this is something the NMaven
> >> folks have dealt with, or perhaps the FreeHEP (NAR plugin) folks. You
> >> should try their mailing lists and see what, if any, suggestions they
> >> may have.
> >>
> >> http://incubator.apache.org/nmaven/
> >> http://java.freehep.org/freehep-nar-plugin/HelloWorld.html
> >>
> >> Wayne
> >>
> >> ---------------------------------------------------------------------
> >> 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: how to write a plugin that uses native (jni) dependencies ?

Posted by Wayne Fay <wa...@gmail.com>.
Probably NMaven was a poor suggestion. You get what you paid for on that one.

But FreeHEP NAR was not.

Also check out this webpage on the Maven User wiki:
http://docs.codehaus.org/display/MAVENUSER/Projects+With+JNI

Wayne

On Sat, Oct 25, 2008 at 6:33 AM, nicolas de loof <ni...@apache.org> wrote:
> I made a grep-search on NMaven to search for "library.path" with no result.
> How does NMaven (that runs .Net tools from Java) relate to setting
> java.library.path on the JVM ?
>
> Nicolas
>
> 2008/10/23 Wayne Fay <wa...@gmail.com>
>
>> > I'd like to package a windows tool as a maven plugin. I can
>> programmatically
>> > run it via JNI (using COM automation) but I need to set the
>> > java.library.path for this to work.
>>
>> I don't know the answer, but I assume this is something the NMaven
>> folks have dealt with, or perhaps the FreeHEP (NAR plugin) folks. You
>> should try their mailing lists and see what, if any, suggestions they
>> may have.
>>
>> http://incubator.apache.org/nmaven/
>> http://java.freehep.org/freehep-nar-plugin/HelloWorld.html
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> 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: how to write a plugin that uses native (jni) dependencies ?

Posted by nicolas de loof <ni...@apache.org>.
I made a grep-search on NMaven to search for "library.path" with no result.
How does NMaven (that runs .Net tools from Java) relate to setting
java.library.path on the JVM ?

Nicolas

2008/10/23 Wayne Fay <wa...@gmail.com>

> > I'd like to package a windows tool as a maven plugin. I can
> programmatically
> > run it via JNI (using COM automation) but I need to set the
> > java.library.path for this to work.
>
> I don't know the answer, but I assume this is something the NMaven
> folks have dealt with, or perhaps the FreeHEP (NAR plugin) folks. You
> should try their mailing lists and see what, if any, suggestions they
> may have.
>
> http://incubator.apache.org/nmaven/
> http://java.freehep.org/freehep-nar-plugin/HelloWorld.html
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: how to write a plugin that uses native (jni) dependencies ?

Posted by Wayne Fay <wa...@gmail.com>.
> I'd like to package a windows tool as a maven plugin. I can programmatically
> run it via JNI (using COM automation) but I need to set the
> java.library.path for this to work.

I don't know the answer, but I assume this is something the NMaven
folks have dealt with, or perhaps the FreeHEP (NAR plugin) folks. You
should try their mailing lists and see what, if any, suggestions they
may have.

http://incubator.apache.org/nmaven/
http://java.freehep.org/freehep-nar-plugin/HelloWorld.html

Wayne

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