为什么这个Maven的JDA依赖版本不起作用?

huangapple go评论65阅读模式
英文:

Why does this maven JDA dependency version not work?

问题

我正在尝试第一次制作 Discord 机器人,但遇到了一个问题。
当我尝试导入 JDA(https://github.com/DV8FromTheWorld/JDA)时,版本号被标记为红色。
当我使用稍旧的版本时,似乎也无法导入任何内容。

<dependencies>
    <dependency>
        <groupId>net.dv8tion</groupId>
        <artifactId>JDA</artifactId>
        <version>4.2.0_204</version>
    </dependency>
</dependencies>

为什么这个Maven的JDA依赖版本不起作用?

图片显示了一个可工作的版本。

英文:

I am trying to make a discord bot for the first time and have run into a problem.
When I'm trying to import JDA(https://github.com/DV8FromTheWorld/JDA) it underlines the version red.
When I use a slightly older version I also can't seem to import anything.

 &lt;dependencies&gt;
     &lt;dependency&gt;
         &lt;groupId&gt;net.dv8tion&lt;/groupId&gt;
         &lt;artifactId&gt;JDA&lt;/artifactId&gt;
         &lt;version&gt;4.2.0_204&lt;/version&gt;
     &lt;/dependency&gt;
 &lt;/dependencies&gt;

为什么这个Maven的JDA依赖版本不起作用?

Image is with a working version

答案1

得分: 1

你是否已经添加了:

&lt;repository&gt;
    &lt;id&gt;jcenter&lt;/id&gt;
    &lt;name&gt;jcenter-bintray&lt;/name&gt;
    &lt;url&gt;https://jcenter.bintray.com&lt;/url&gt;
&lt;/repository&gt;

在你的 POM 文件中?你正在使用的发布版本并未在 Maven Central 上出现。请参考此指南中的安装说明。

英文:

Have you added:

&lt;repository&gt;
    &lt;id&gt;jcenter&lt;/id&gt;
    &lt;name&gt;jcenter-bintray&lt;/name&gt;
    &lt;url&gt;https://jcenter.bintray.com&lt;/url&gt;
&lt;/repository&gt;

repository in you POM? The release version you are using is not present on Maven Central. Please refer this guide with installation instruction.

huangapple
  • 本文由 发表于 2020年9月13日 19:54:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/63870453.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定