Version: 1.5.x

安装

Spring Boot项目

若您的项目基于Spring Boot,那只要添加下面一个 maven 依赖便可。

<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>spring-boot-starter-forest</artifactId>
<version>1.5.0-RC5</version>
</dependency>

如果您用的是Gradle:

compile group: 'com.dtflys.forest', name: 'spring-boot-starter-forest', version: '1.5.0-RC1'

Spring项目

若您的项目基于非Spring Boot的普通Spring项目,则需添加 Forest 核心包依赖和 Forest Spring 包依赖

<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-core</artifactId>
<version>1.5.0-RC5</version>
</dependency>
<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-spring</artifactId>
<version>1.5.0-RC5</version>
</dependency>

如果您用的是Gradle:

compile group: 'com.dtflys.forest', name: 'forest-core', version: '1.5.0-RC5'
compile group: 'com.dtflys.forest', name: 'forest-spring', version: '1.5.0-RC5'

非Spring普通项目

若您的项目既非Spring Boot也非普通Spring项目,只需添加 Forest 核心包依赖

<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>forest-core</artifactId>
<version>1.5.0-RC5</version>
</dependency>

如果您用的是Gradle:

compile group: 'com.dtflys.forest', name: 'forest-core', version: '1.5.0-RC5'

添加JSON框架依赖

如果您的项目中还没有JSON解析框架,如FastjsonJackson,请根据需要添加以下依赖。如果已经有了,可以跳过此步

Fastjson依赖:版本 >= 1.2.48

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.48</version>
</dependency>

Jackson依赖:版本 >= 2.9.10

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.10</version>
</dependency>
Last updated on