为了账号安全,请及时绑定邮箱和手机立即绑定

如何修复“任务‘compileJava’执行失败”错误。

如何修复“任务‘compileJava’执行失败”错误。

ABOUTYOU 2024-01-05 16:55:32
好的,我正在 Intellij Idea 中使用 JDA 编写 Discord 机器人,并且使用 botCommons 进行嵌入。使用 Gradle 并导入 botCommons jar 文件。那是成功的。然而。我尝试启动机器人并在控制台中遇到此问题:Execution failed for task ':compileJava'.> Could not resolve all files for configuration ':compileClasspath'.   > Could not find com.afollestad:ason:1.4.16.     Searched in the following locations:       - https://jcenter.bintray.com/com/afollestad/ason/1.4.16/ason-1.4.16.pom       - https://jcenter.bintray.com/com/afollestad/ason/1.4.16/ason-1.4.16.jar       - https://repo.maven.apache.org/maven2/com/afollestad/ason/1.4.16/ason-1.4.16.pom       - https://repo.maven.apache.org/maven2/com/afollestad/ason/1.4.16/ason-1.4.16.jar       - https://jitpack.io/com/afollestad/ason/1.4.16/ason-1.4.16.pom       - https://jitpack.io/com/afollestad/ason/1.4.16/ason-1.4.16.jar     Required by:         project :         project : > com.github.duncte123:botCommons:fbb8f98我有我的 build.gradle 文件:plugins {    id'java'    id'application'    id'com.github.johnrengelman.shadow' version '2.0.4'}mainClassName = 'me.ntmnathan.RoryMercury.Main'version '1.0'sourceCompatibility = 1.8repositories {    jcenter()    mavenCentral()    maven { url 'https://jitpack.io' }}dependencies {    compile group: 'net.dv8tion', name: 'JDA', version: '3.8.0_434'    compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'    compile group: 'com.github.duncte123', name: 'botCommons', version: 'fbb8f98'    compile group: 'com.afollestad', name: 'ason', version: '1.4.16'}compileJava.options.encoding = 'UTF-8'抱歉,我对 Java Discord 机器人开发有点陌生,但如果有任何帮助,我们将不胜感激。
查看完整描述

2 回答

?
慕村225694

TA贡献1880条经验 获得超4个赞

com.afollestad:ason:1.4.16位于:
https://repo.spring.io/libs-release/com/afollestad/ason/1.4.16/

您需要在repositories列表中再添加一个存储库:

maven { url 'https://repo.spring.io/libs-release' }


下一次,这个答案是由以下人找到的:

  • 谷歌com.afollestad:ason:1.4.16

  • 单击com.afollestad » ason » 1.4.16 - Maven Repository搜索结果链接

  • 阅读注释:

    注意:这个工件位于 Spring Lib Release 存储库(https://repo.spring.io/libs-release/


查看完整回答
反对 回复 2024-01-05
?
至尊宝的传说

TA贡献1789条经验 获得超10个赞

好的:

  1. 您的 Gradle 构建失败,因为它找不到此依赖项:

    compile group: 'com.afollestad', name: 'ason', version: '1.4.16'
  2. 谷歌快速搜索证实它似乎可以在 MavenRepository 上使用:

    https://mvnrepository.com/artifact/com.afollestad/ason/1.4.6

  3. 但同一个链接显示您需要将其添加到您的 build.gradle 中:

注意:这个工件位于 Spring Plugins 存储库(https://repo.spring.io/plugins-release/

  1. 所以改变这个:

repositories {

   jcenter()

   mavenCentral()


   maven { 

     url 'https://jitpack.io'

   }

   maven { 

     url 'https://repo.spring.io/plugins-release/'

   }


查看完整回答
反对 回复 2024-01-05
  • 2 回答
  • 0 关注
  • 55 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信