|
Maven
Maven repository and usage instructions
Featured IntroductionJNAerator is fully Maven-ized, which means that the following are possible :
JNAerator's Maven-generated sites are available here. TODO future developments might include Maven archetypes to bootstrap standard native library wrappings projects Repository<project> ... <repositories> <repository> <id>sonatype</id> <name>Sonatype OSS Snapshots Repository</name> <url>http://oss.sonatype.org/content/groups/public</url> </repository> <repository> <id>nativelibs4java-repo</id> <url>http://nativelibs4java.sourceforge.net/maven</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>sonatype</id> <name>Sonatype OSS Snapshots Repository</name> <url>http://oss.sonatype.org/content/groups/public</url> </pluginRepository> <pluginRepository> <id>nativelibs4java-repo</id> <url>http://nativelibs4java.sourceforge.net/maven</url> </pluginRepository> </pluginRepositories> ... </project> UsageJNAerator runtime classesNeeded to support JNAerated sources : <project> ... <dependencies> <dependency> <groupId>com.nativelibs4java</groupId> <artifactId>jnaerator-runtime</artifactId> <version>0.9.10-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies> ... </project> Maven JNAerator Plugin
<project> ... <build> <plugins> ... <plugin> <groupId>com.nativelibs4java</groupId> <artifactId>maven-jnaerator-plugin</artifactId> <version>0.9.10-SNAPSHOT</version> </plugin> ... </plugins> </build> ... </project> mvn com.jnaerator:maven-jnaerator-plugin:jnaerate This will create Java & Scala files in target/generated-sources | |
► Sign in to add a comment
Above version 0.9.2 of the plugin, I cannot get it to work with Maven 2.
In version 0.9.2, I cannot seem to use the -runtime command line argument (the plugin complains that "file -runtime does not exist"). I suspect the argument only works in versions about 0.9.2, but I cannot download any dependencies for 0.9.3 or 0.9.4. I tried switching the maven repository to Sourceforge, as I noticed the later versions of the plugin are there, but to no avail.
for 0.9.4, it complains that it cannot resolve version "org.rococoa:rococoa-core:jar:${parent.version}" for 0.9.3, it complains about "com.jnaerator:jna-jnaerator:jar:${jna.version}"
Good work, keep it up. Just two issues to get it working:
Regards!
@guilleguti84 Thanks, fixed !
@brice.copy Sorry I missed your comment... repository issues for 0.9.4 should now be fixed, but I'd advise using 0.9.5-SNAPSHOT to get *many* fixes.
Cheers
In case you want to automatically generate the sources as part of the build, bind jnaerator plugin to generate-sources lifecycle:
<plugin> <groupId>com.jnaerator</groupId> <artifactId>maven-jnaerator-plugin</artifactId> <version>0.9.3</version> <executions> <execution> <phase>generate-sources</phase> <goals><goal>jnaerate</goal></goals> </execution> </executions> </plugin>And, in order to have those generated files compiled as part of the build and included in the final JAR, add the source directory to the list of source directories that Maven is aware of with help from build-helper-maven-plugin:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.5</version> <executions> <execution> <phase>generate-sources</phase> <goals><goal>add-source</goal></goals> <configuration> <sources><source>target/generated-sources/java</source></sources> </configuration> </execution> </executions> </plugin>Hi, I am using maven-jnaerator-plugin version 0.9.8 and it tries to download this:
Why is this happening? Why is it not using all 0.9.8 version jars and poms?
Continuing the above comment, I keep getting timeouts from the blackpad server:
Downloading: http://www.blackpad.fr/nexus/content/groups/public/com/jnaerator/jnaerator-parent/0.9.9-SNAPSHOT/maven-metadata.xml WARNING? Could not transfer metadata com.jnaerator:jnaerator-parent:0.9.9-SNAPSHOT/maven-metadata.xml from blackpad-nexus (http://www.blackpad.fr/nexus/content/groups/public): Error transferring file: Connection timed out
Downloading: http://www.blackpad.fr/nexus/content/groups/public/com/nativelibs4java/nativelibs4java-parent/1.6-SNAPSHOT/maven-metadata.xml
This takes about 2-3 annoying minutes. It does not stop the Maven build and does not seem to have any additional effect.
Is it possible to remove this download?
Thanks, Ynon
0.9.9 version avoids SNAPSHOT dependecies
Dear JNAerator team, at first thanks for this project. I would like to use it but I have a question. I want to use the maven implemntation where do I have to put my c header files? it would be very helpfull if you could provide in fully maven example.
Thanks a lot.
The name of the goal is 'generate', not 'jnaerate'. From JNAeratorMojo.java: