http://blog.csdn.net/u013177446/article/details/53944424
************************************************************
The jar generated by the MAVEN default package is not able to run directly because of the meta-inf/manifest in the jar file. There is no Main-class line in MF, in order to generate the executable jar file, you need to use Maven's plugin, Maven-shade-plugin, configure the plugin as follows:
<Properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <Exec.mainclass>study20161230. Test</Exec.mainclass> </Properties> <Build> <Plugins> <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-shade-plugin</Artifactid> <version>2.3</version> <executions> <Execution> <Phase>Package</Phase> <Goals> <goal>Shade</goal> </Goals> <Configuration> <Transformers> <TransformerImplementation= "Org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <MainClass>${exec.mainclass}</MainClass> </Transformer> </Transformers> <Artifactset> </Artifactset> <!--<outputfile>${project.build.directory}/${project.artifactid}-${project.version}-fat.jar</ Outputfile> - </Configuration> </Execution> </executions> </plugin> </Plugins> </Build>
"MAVEN" MAVEN package generates executable jar file