博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【spring Boot】2.在Myecplise上把spring Boot项目打包 war包和jar包
阅读量:6683 次
发布时间:2019-06-25

本文共 3845 字,大约阅读时间需要 12 分钟。

========================================================第一部分=============================================================

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

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

看一下pom.xml文件

4.0.0
com.sxd.springBootExample
firstSpringBootExample
0.0.1-SNAPSHOT
war
maven-war-plugin
3.0
org.springframework.boot
spring-boot-starter-parent
1.5.7.RELEASE
org.springframework.boot
spring-boot-starter-web
View Code

 

1.右键项目--->Debugs As--->Debugs Configurations

 

2.跟着步骤走

 

3.报错啦:

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

[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
View Code

解决方法:http://www.cnblogs.com/sxdcgaq8080/p/7617542.html

 

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

 

 

 

5.执行之后结果如下:

 

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

第二部分,使用springBoot提供的插件,将项目打包为jar包

 

你可能感兴趣的文章
Android蓝牙3.0和4.0开发记录
查看>>
EasyFastCMS系列教学课程——1、三层框架的搭建
查看>>
几个经常用到的字符串的截取(java)
查看>>
浅谈Linux文件系统架构
查看>>
Android 一个对sharedpreferences 数据进行加密的开源库
查看>>
SSM-SpringMVC-05:SpringMVC视图解析器InternalResourceViewResolver配置
查看>>
前端学数据库之中文乱码问题
查看>>
Redis命令参考简体中文版 2.4.1
查看>>
Maven+SSM框架(Spring+SpringMVC+MyBatis)(二)
查看>>
Codeforces Round #327 (Div. 2)
查看>>
表达式求值专题
查看>>
ACM配置指南
查看>>
64. Extjs中grid 的ColumnModel 属性配置
查看>>
83.导入项目时,用npm install安装module
查看>>
MSSQL日期时间函数大全
查看>>
二度xml<一>
查看>>
爱情令人意醉神迷
查看>>
ASP.NET 生成图片验证码
查看>>
ToString()转换格式;DateTime.ToString()用法详解
查看>>
如何让Apache不显示服务器信息
查看>>