halo项目源码本地部署解决方案

@

前言

先列举会出错的点:
1、Plugin [id: 'org.springframework.boot', version: '2.2.5.RELEASE'] was not found in any of the follow

2、Bean method 'buildProperties' in 'ProjectInfoAutoConfiguration' not loaded @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}'

3、not found C:\Users\Lenovo.halo\templates\themes\anatole 说明文件

OK,开始部署


1、拉取halo项目

执行:

git clone https://github.com/halo-dev/halo.git

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429152426178.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA==,size_16,color_FFFFFF,t_70)
安装成功后再说。
ps:在使用idea打开之前,根据其他博客
安装好gradle


2、使用idea打开halo

在打开的时候会有需要配置的gradle,根据以下情况自行选择

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429152544751.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA==,size_16,color_FFFFFF,t_70)


3、构建的时候出现的错误

(1)springboot 2.2.5插件找不到 (编译时)
Plugin [id: 'org.springframework.boot', version: '2.2.5.RELEASE'] was not found in any of the follow

问题原因: 就是项目内没有这个插件,所以我们得build,让它去下载这个插件
问题解决: 1、gradle build 2、刷新一下gradle
gradle build在该项目的文件目录下进行。。。

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429152805777.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA==,size_16,color_FFFFFF,t_70)
(2)找不到build-info.properties文件 (运行时)
Bean method 'buildProperties' in 'ProjectInfoAutoConfiguration' not loaded @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}'

问题原因: 是因为我们运行时的构建器是默认Idea
问题解决: 把运行时构建器改为gradle即可
![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020042915370461.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA,size_16,color_FFFFFF,t_70)
然后
![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020042915285119.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA
,size_16,color_FFFFFF,t_70)
(3)找不到说明文件 (运行时)

not found C:\Users\Lenovo.halo\templates\themes\anatole 说明文件

问题原因: 不知道是因为啥,应该是模板没有初始化的原因吧。
问题解决: 把自己运行过的anatole文件直接cope过去即可

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429152936731.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA==,size_16,color_FFFFFF,t_70)

没有anatoe文件的可以用我提供的:
链接:https://pan.baidu.com/s/1X7uC15Y_nNwNQ3i3G7a1Jg
提取码:8yv8

4、结果

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429153940984.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA,size_16,color_FFFFFF,t_70)
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20200429154001676.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzk0MzU0OA
,size_16,color_FFFFFF,t_70)

后言

至此就全部解决问题了,如果还有问题可以下方评论区提问,我会第一时间回答。

bye~

posted @ 2020-04-29 15:44  陌陌卡上  阅读(1890)  评论(0)    收藏  举报