Update ConfiguringProjects.md

[no ci]
This commit is contained in:
微莹·纤绫 2022-01-03 23:52:38 +08:00 committed by GitHub
parent bc52924602
commit f7e295e20c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,11 +38,11 @@
```kotlin ```kotlin
plugins { plugins {
kotlin("jvm") version "1.5.10" // 确保添加 Kotlin kotlin("jvm") version "1.5.30" // 确保添加 Kotlin
} }
dependencies { dependencies {
api("net.mamoe", "mirai-core", "2.7.0") api("net.mamoe", "mirai-core", "2.9.1")
} }
``` ```
@ -58,11 +58,11 @@ dependencies {
```groovy ```groovy
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.10' // 确保添加 Kotlin id 'org.jetbrains.kotlin.jvm' version '1.5.30' // 确保添加 Kotlin
} }
dependencies { dependencies {
implementation 'net.mamoe:mirai-core:2.7.0' implementation 'net.mamoe:mirai-core:2.9.1'
} }
``` ```
@ -77,7 +77,7 @@ Mirai 在开发时需要 `net.mamoe:mirai-core-api`, 在运行时需要 `net.mam
使用 `mirai-bom` 也会对 Dependabot 等自动化依赖管理程序更加友好。 使用 `mirai-bom` 也会对 Dependabot 等自动化依赖管理程序更加友好。
```kotlin ```kotlin
dependencies { dependencies {
api(platform("net.mamoe:mirai-bom:2.8.0")) api(platform("net.mamoe:mirai-bom:2.9.1"))
api("net.mamoe:mirai-core-api") // 编译代码使用 api("net.mamoe:mirai-core-api") // 编译代码使用
runtimeOnly("net.mamoe:mirai-core") // 运行时使用 runtimeOnly("net.mamoe:mirai-core") // 运行时使用
} }
@ -86,7 +86,7 @@ dependencies {
尤其注意 Dependabot 等依赖管理程序可能会导致模块版本不同。 尤其注意 Dependabot 等依赖管理程序可能会导致模块版本不同。
```kotlin ```kotlin
dependencies { dependencies {
val miraiVersion = "2.8.0" val miraiVersion = "2.9.1"
api("net.mamoe", "mirai-core-api", miraiVersion) // 编译代码使用 api("net.mamoe", "mirai-core-api", miraiVersion) // 编译代码使用
runtimeOnly("net.mamoe", "mirai-core", miraiVersion) // 运行时使用 runtimeOnly("net.mamoe", "mirai-core", miraiVersion) // 运行时使用
} }
@ -94,6 +94,8 @@ dependencies {
## B. 使用 Maven ## B. 使用 Maven
> 推荐使用 gradle, 使用 maven 您可能会遇到各种奇怪的依赖错乱问题
`pom.xml` 中添加 mirai 依赖: `pom.xml` 中添加 mirai 依赖:
```xml ```xml
@ -101,7 +103,7 @@ dependencies {
<dependency> <dependency>
<groupId>net.mamoe</groupId> <groupId>net.mamoe</groupId>
<artifactId>mirai-core-jvm</artifactId> <artifactId>mirai-core-jvm</artifactId>
<version>2.7.0</version> <version>2.9.1</version>
</dependency> </dependency>
</dependencies> </dependencies>
``` ```