idea将spring boot项目打成jar包

1、右键springboot项目,选择Open module Settings.

2、选择Artifacts,点击加号,选择JAR,选择From modules with dependencies

3、出现一个弹框,module选择项目名称,class选择项目的java文件,jar files from libraries选择copy to the output......

4、点击确定,确定,选择MavenProjects,选择你的项目,先双击clean,然后双击package。如果出现

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project xxx: There are test failures.错误,在测试的java类的类名上加上@Ignore注解即可。

posted @ 2018-09-26 10:21  浮or沉  阅读(48)  评论(0编辑  收藏  举报