https://blog.csdn.net/weixin_38653290/article/details/84647019
1.pom中build指定mainClass 但是 META-INF\MANIFEST.MF文件中沒有指定Main-Class: test.core.Core
java -jar test-jar-with-dependencies.jar //執行成功
java -cp test-jar-with-dependencies.jar test.core.Core //執行失敗,提示jar中沒有主清單屬性
2.pom中build沒有指定mainClass 但是 META-INF\MANIFEST.MF文件中指定了Main-Class: test.core.Core
java -jar test-jar-with-dependencies.jar //執行失敗,提示jar中沒有主清單屬性
java -cp test-jar-with-dependencies.jar test.core.Core //執行成功
3.pom中build指定mainClass && META-INF\MANIFEST.MF文件中增加了Main-Class: test.core.Core
java -cp test-jar-with-dependencies.jar test.core.Core //執行成功
java -jar test-jar-with-dependencies.jar //執行成功