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
打开工程,直接打开检出文件夹

IDEA搭建jeesite4.0

修改web\src\main\resources\config\application.yml文件中的数据库连接和服务端口信息等,以mysql为例

IDEA搭建jeesite4.0

在mysql中新建jeesite数据库,执行web\bin\init-data.bat文件,完成初始化数据库操作。

IDEA搭建jeesite4.0

将parent目录和web目录下的pom.xml文件作为maven工程添加到项目中

IDEA搭建jeesite4.0

配置项目jdk及maven版本等

IDEA搭建jeesite4.0

运行

IDEA搭建jeesite4.0

完成

IDEA搭建jeesite4.0

打开系统登录页面

IDEA搭建jeesite4.0

运行过程可能出现的错误:
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>

重新启动就好啦~

相关文章:

  • 2022-01-01
  • 2021-12-02
  • 2021-06-15
  • 2021-09-01
  • 2021-10-31
  • 2021-06-26
  • 2021-05-04
  • 2021-11-11
猜你喜欢
  • 2021-04-23
  • 2022-01-02
  • 2021-08-31
  • 2021-12-10
  • 2021-11-22
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案