学习开源项目Halo(1) - 初步了解与运行Halo
0.前言
学习开源项目就像看一本和技术有关的书籍,技术与技术之间往往是有层层递进或者先导性的关系,因此学习开源项目需要有一定的基础。
本人也学的不扎实,想通过学习与了解一个优秀的项目来对自己知识查漏补缺,并学习如何构建一个优质的项目,如果文章内容有所问题,欢迎在评论区批评指正。
1.Halo简介
官方介绍:Halo 一款现代化的个人独立博客系统(由Java开发)
Github网址 :https://github.com/halo-dev/halo
Halo官方网站: https://halo.run/
2.Halo项目运行
在Halo的GitHub首页中使用git clone的方式或者下载zip压缩包的将项目保存到自己电脑。
我是下载的压缩包,解压后使用IDEA导入即可。具体步骤可参考以下视频:
视频演示如何玩转一个开源项目 |如何运行+如何读代码 |顺便讲讲IDEA和Spring Boot
在上述视频的评论区也有出现各种BUG如何解决的方法。
运行成功后可看到如下显示:
控制台信息:可看到项目首页与项目管理员首页的地址。
首先会有 Halo安装向导
填写好安装信息后,会跳转至个人仪表盘页面,包含自己博客的各种信息
这是个人博客的首页,Halo自动生成了一篇HELLO HALO的博客。
3.Halo项目涉及到的技术栈
前往build.gradle文件,查看项目依赖即可。gradle与maven都是项目管理工具,添加依赖时会用到。
Gradle是一个基于Apache Ant和Apache Maven概念的项目自动化构建工具
看dependencies内的内容即可:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-undertow'
implementation 'org.springframework.boot:spring-boot-starter-freemarker'
implementation "io.github.biezhi:oh-my-email:$ohMyEmailVersion"
implementation "cn.hutool:hutool-core:$hutoolVersion"
implementation "cn.hutool:hutool-crypto:$hutoolVersion"
implementation "cn.hutool:hutool-extra:$hutoolVersion"
implementation "com.upyun:java-sdk:$upyunSdkVersion"
implementation "com.qiniu:qiniu-java-sdk:$qiniuSdkVersion"
implementation "com.aliyun.oss:aliyun-sdk-oss:$aliyunSdkVersion"
implementation "com.baidubce:bce-java-sdk:$baiduSdkVersion"
implementation "com.qcloud:cos_api:$qcloudSdkVersion"
implementation "io.springfox:springfox-swagger2:$swaggerVersion"
implementation "io.springfox:springfox-swagger-ui:$swaggerVersion"
implementation "org.apache.commons:commons-lang3:$commonsLangVersion"
implementation "org.apache.httpcomponents:httpclient:$httpclientVersion"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$dataformatYamlVersion"
implementation "org.eclipse.jgit:org.eclipse.jgit:$jgitVersion"
implementation "com.vladsch.flexmark:flexmark:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-attributes:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-autolink:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-emoji:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-escaped-character:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-gfm-tasklist:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-ins:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-media-tags:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-tables:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-toc:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-yaml-front-matter:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-html-parser:$flexmarkVersion"
implementation "net.coobird:thumbnailator:$thumbnailatorVersion"
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
有的用过,有的听说过,有的没见过…
- Spring Boot 基于Spring的web开发框架
- Freemarker 一种模板引擎
- H2 Database:嵌入式数据库,无需安装
- Mysql:关系型数据库
- Spring-data-JPA:持久层框架
- Ehcache:缓存框架
- Lombok:Java高效开发工具
- swagger2:在线API生成工具
- hutool:一个Java基础工具类(也是一个有名的Github开源项目)
- 七牛云:是国内领先的企业级公有云服务商,致力于打造以数据为核心的场景化PaaS服务。
- 阿里云 OSS:提供基于网络的数据存取服务
- flexmark:将MarkDown转为HTML
等等…
具体就不一个个说明了,很多东西本人也没用过。会在后面的博客慢慢更新,学习整个项目。