Fix build of JNI sources. Use the generate-sources phase.
all: lib/libyaz4j.so
+.PHONY: generate-sources
+
+generate-sources: src/libyaz4j.cpp
+
src/libyaz4j.cpp: libyaz4j.i
swig -I"include" -I"$(YAZ_PREFIX)/include" -outdir ../src/main/java/org/yaz4j/jni -package org.yaz4j.jni -o src/libyaz4j.cpp -c++ -java libyaz4j.i
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
+ <id>native-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <exec dir="libyaz4j" executable="make" failonerror="true">
+ <arg value="generate-sources"/>
+ </exec>
+ </tasks>
+ </configuration>
+ </execution>
+
+ <execution>
<id>build-native</id>
<phase>compile</phase>
<goals>