One solution (the hack way) is to have antrun call the required build steps for you, or even just fork the native code build tool
Another solution is to refactor your maven projects, take the unit tests out of that module and put them into a third module. A = java B = jni C = unit tests of java B depends on A C depends on B & A On Tue, May 27, 2008 at 4:27 PM, Dave Rathnow <[EMAIL PROTECTED]> wrote: > > Okay. > > Can you explain how one uses Maven to build jni libraries? Assume you > have a jar project containing the Java source file (i.e. main and test) > that provides the interface to the native code, and another project that > contains the native code, how do you build them? > > Building the jar file requires the unit tests to run but they rely on > the native library but it can't be built because it relys on the Java > class in the jar file that is built from the Java project, but it can't > be built because it can't run unit tests that rely on the native code > from the native project but it can't be built....and on it goes. Chicken > and Egg problem. > > How do you do this? > > Dave. > > > -----Original Message----- > From: Brian Fox [mailto:[EMAIL PROTECTED] > Sent: May 26, 2008 09:52 PM > To: Maven Users List > Subject: Re: Can you build native lib and Jar with a single pom.xml? > > The golden rule is one pom, one artifact. > > On May 26, 2008, at 5:41 PM, "Dave Rathnow" <[EMAIL PROTECTED]> > wrote: > > > > > I have built a pom to build a native JNI library but the Java class > > that > > sits on top of it is in a separate project. It makes running unit > > tests > > a little tricky. I would like to move the Java code into the same > > project and have the Jar and the library built with a single pom. > > > > Is this possible? If so, how does one go about getting Maven to build > > both a native library and a jar file? > > > > Thanks, > > Dave. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
