I'm trying to get some native dependencies (LWJGL) working smoothly in Eclipse (Juno) with Maven.
Current situation:
maven-nativedependencies-plugin
version 0.0.6. This seems to successfully download and unpack the native libraries to the target/natives
subdirectory of my project. Fine so far.target/natives
directory in Properties / Java Build Path / Maven Dependencies / Native Library Location / Edit...
Maven / Update Project...
because the Native Library Location is cleared (presumably by m2e re-configuring the project according to the pom)What is the best way to get this working reliably?
Try this steps;
For maven project;
Make sure your pom.xml like this;
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.googlecode.mavennatives</groupId>
<artifactId>maven-nativedependencies-plugin</artifactId>
<version>0.0.6</version>
<executions>
<execution>
<id>unpacknatives</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>bundle-project-sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/META-INF/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
And then left click on the eclipse project, go to the maven menu and click on "update project configuration". If you are still having problems, in the eclipse console tab, open the maven console and do the "update project configuration" option again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With