gpt4 book ai didi

gradle - 找不到ID为 'org.ajoberstar.grgit'的插件

转载 作者:行者123 更新时间:2023-12-03 04:56:47 30 4
gpt4 key购买 nike

我正在尝试编译名为VeinMiner的开源Minecraft mod。
我使用./gradlew build进行编译。
但是失败了,这给了我这个原因:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/xxxx/Desktop/VeinMiner/build.gradle' line: 26

* What went wrong:
A problem occurred evaluating root project 'VeinMiner'.
> Plugin with id 'org.ajoberstar.grgit' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 14.778 secs

我试图再次git clone它或在sudo中运行它。
但是,这两个都不起作用。

这个构建过程是这样的:
(太长,因此我选择了其中的一部分)
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}

plugins {
id 'com.matthewprenger.cursegradle' version '1.0.7'
id 'org.ajoberstar.grgit' version '1.3.2'
}

apply plugin: 'forge'
apply plugin: 'maven'
apply plugin: "org.ajoberstar.grgit"
apply plugin: "com.matthewprenger.cursegradle"

ext.git = grgit.open(file('.'))

ext {
configFile = file "build.properties"

revision = git.head().abbreviatedId
depth = git.log().size()
}

我希望构建成功。有人遇到过这种情况吗?

最佳答案

提到的插件org.ajoberstar.grgit被应用了两次。第一次通过新的plugins块应用它,第二次通过旧的apply plugin:方法应用。只需删除apply plugin: "org.ajoberstar.grgit"行,该错误应消失。

要通过旧的apply plugin:方法应用插件,需要从buildscript块内的任意存储库解析插件包。这与通过普通的repositoriesdependencies块解决项目依赖项的方式相同。

新的plugins块直接从Gradle plugin portal解析插件,并在同一步骤中应用它们。

我猜想将如何应用于插件的方式已更改为较新的方式,但是未删除旧方法。在现有设置中,该插件可能已从本地Gradle缓存中解析出来,但是在新设置中找不到该插件。

关于gradle - 找不到ID为 'org.ajoberstar.grgit'的插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57722140/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com