您的位置:首页 > 编程语言 > Java开发

【spring Boot】2.在Myecplise上把spring Boot项目打包 war包和jar包

2017-10-01 18:15 676 查看
========================================================第一部分=============================================================

第一部分:使用maven项目中自带的插件,将maven的web项目打包成war包

使用的项目是上一章中的maven项目,原封不动

看一下pom.xml文件

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building firstSpringBootExample 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ firstSpringBootExample ---
[INFO] Deleting D:\workspace2\firstSpringBootExample\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ firstSpringBootExample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ firstSpringBootExample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\workspace2\firstSpringBootExample\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.398 s
[INFO] Finished at: 2017-10-01T17:41:26+08:00
[INFO] Final Memory: 13M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project firstSpringBootExample: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException[/code] 
View Code
解决方法:http://www.cnblogs.com/sxdcgaq8080/p/7617542.html

4.解决错误之后,重新进行打包操作





5.执行之后结果如下:





=====================================================第二部分=========================================================

第二部分,使用springBoot提供的插件,将项目打包为jar包
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: