转自:http://www.jianshu.com/p/fd5bd8657852
修改pom.xml
4.0.0 com.mkyong App 1.0-SNAPSHOT jar App http://maven.apache.org UTF-8 junit junit 3.8.1 test org.apache.maven.plugins maven-shade-plugin 1.2.1 package shade com.mkyong.App
<mainClass>com.mkyong.App</mainClass>此处的内容去src/main/java中寻找
例如:再运行mvn clean compile,mvn clean package,java -jar target/App-1.0-SNAPSHOT.jar
就看到可爱的Hello World!了.