1)配置pom.xml
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.dw.Main</mainClass>
</manifest>
</archive>
</configuration>
<version>2.4</version>
</plugin>
2)打包
右键pom.xml->runnable configuration->goals右侧select按钮->展开assembly->选中assembly->点击ok->返回后点击Run->查看target目录生成好的jar