Create runnable jar with maven 3.1 using maven-dependency-plugin doesn't create runnable jar

后端 未结 7 1372
予麋鹿
予麋鹿 2021-01-15 16:43

Using Maven 3.1
Eclipse Helios

Aspekt:

Try to create a runable jar file using maven-jar/dependency-plugins.

Problem:

相关标签:
7条回答
  • 2021-01-15 17:03

    Try to provide entry into manifest file:

    Main-Class: YourClassWithMainMethod
    

    And also see this post. So you can make it manually and see the difference.

    If dependency-jars is a directory also try:

    java -cp ./dependency-jars/* -jar program.jar
    

    I still cannot post comments, so please show what are these NoCLassDefFoundErrors. And have you tried to do the same jar file manually from Eclipse and see the difference?

    You have dependency dependency-jars/commons-cli-1.3-20140221.042048-103.jar in your manifest but you wrote you have SNAPSHOT version in directory. And there is only commons-cli:commons-cli:20040117.000000 in maven central.

    @robermann please see this post (to work it should be in double quotes though)

    0 讨论(0)
提交回复
热议问题