Bundle native dependencies in runnable .jar with Maven

后端 未结 3 946
借酒劲吻你
借酒劲吻你 2020-12-15 06:43

I have a project managed in Maven that has some native dependencies (LWJGL).

Everything works fine in development, but now I want to set up Maven so

3条回答
  •  抹茶落季
    2020-12-15 07:28

    Here is the plugin you need in your pom.xml to run your build with the required run Parameter you mentioned:

        
            org.codehaus.mojo
            exec-maven-plugin
            1.6.0
            
                java
                
                    -Djava.library.path=target/natives
                    -classpath
                    
                    my.main.package.MainClass
                
            
        
    

    Then run your LWJGL-Program using

    mvn exec:exec
    

提交回复
热议问题