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 //执行成功
还在学习中,这个是借鉴别人的,还没完全实验;