Hi Luis,
I think that your project organization is incorrect because you have a
circular dependence: your source code needs the JNI lib (example: for
runtime or testing purpose), and your library needs the java source code
to generate header files.
If you use a multi-modules project with the following dependencies, that
works fine (I use this decomposition):
----- java-api
|
|---java-native
|
|---lib-native
with:
- java-api: the module containing all java classes that calls the
JNI layer (the Java class containing the native methods is not included
in this module)
- java-native: the module containing all java classes that contain
only native methods
- lib-native: the DLL or .SO source code
dependencies:
- java-api depends of java-native and lib-native, so it will build
in last position
- lib-native depends of java-native, so it will build in second position
- java-native has no dependence, so it will be build in first
____________________________________________________________________________
Christophe DENEUX / Capgemini Sud / Méditerranée
Technical Leader
Tel: + 33 4 93 72 43 74 / www.capgemini.com
Fax: + 33 4 93 21 02 95
Porte de l'Arénas - Entrée B / 455 Promenade des Anglais / 06200 Nice
Join the Collaborative Business Experience
____________________________________________________________________________
Luís Soares a écrit :
Hello all,
I am trying to build native classes with maven2 but there is an issue when
calling javah.
The things should happen in the following order:
i) Build the java source classes that have calls to JNI.
ii) Dump the class files into target/classes
iii) Using the "native-maven-plugin" call "javah" to generate the header
files. This needs the just compiled classes in target/classes in the
classpath
iv) Compile the C source files and create the library.
The problem is that the compiled classes are not available in the classpath
when javah is called. Is there a way to do this without making use of an ant
task?
How can I change the classpath when runnig the native-maven-plugin in order
for the javah be called with -classpath $CLASSPATH:
${project.build.directory}/classes ?
If this is trivial, my apologies, but I have just started using maven.
Thanks.
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]