JeeSite是一个很优秀的开发框架,但是发现官网只有Eclipse配置方式,没有IDEA的配置方式,遂自己踩坑。为了以后方便使用,现将步骤记录下来以备不时之需。
环境:Java SDK 1.8 下载
2,Apache Maven 3.3.0+ 下载
3,MySql 5.7.11+ 下载
检出JeeSite4源代码:
$ git clone https://gitee.com/thinkgem/jeesite4.git
打开工程,直接打开检出文件夹
修改web\src\main\resources\config\application.yml文件中的数据库连接和服务端口信息等,以mysql为例
在mysql中新建jeesite数据库,执行web\bin\init-data.bat文件,完成初始化数据库操作。
将parent目录和web目录下的pom.xml文件作为maven工程添加到项目中
配置项目jdk及maven版本等
运行
完成
打开系统登录页面
运行过程可能出现的错误:
java.lang.NoClassDefFoundError: javax/servlet/ServletOutputStream
或类似如下
Connected to the target VM, address: '127.0.0.1:47738', transport: 'socket'
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
09-27 11:01:39.866 ERROR [org.springframework.boot.SpringApplication] - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at com.jeesite.modules.config.Application.main(Application.java:24)
解决方法: 打开web目录及parent目录下的pom.xml文件,将 <scope>provided</scope> 修改为<scope>compile</scope>
重新启动就好啦~