1

我正在尝试构建一个不和谐的应用程序,但由于某种原因它无法访问 JDA。这是错误:

The POM for net.dv8tion:JDA:jar:3.6.2_362 is missing, no dependency information available

编辑:这是我的 POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>DiscordBot</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>3.6.2_362</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>jcenter</id>
            <name>jcenter-bintray</name>
            <url>http://jcenter.bintray.com</url>
        </repository>
    </repositories>
</project>
4

3 回答 3

3

根据JDA 的自述文件,目前的最新版本3.6.0_362不是3.6.2_362,因此您可能想要更改它。

于 2018-05-11T18:46:40.460 回答
0

下面是一个示例 JDA maven pom 文件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>DiscordBot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>bot</name>
<description>General purpose bot</description>
<dependencies>
    <dependency>
        <groupId>net.dv8tion</groupId>
        <artifactId>JDA</artifactId>
        <version>3.6.0_362</version>
    </dependency>
    <dependency>
        <groupId>com.jagrosh</groupId>
        <artifactId>jda-utilities</artifactId>
        <version>2.1</version>
        <scope>compile</scope>
        <type>pom</type>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>jcenter</id>
        <name>jcenter-bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
    <repository>
        <id>central</id>
        <name>bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>

于 2018-05-20T23:06:08.283 回答
0

为什么要使用这么旧的版本?

最新来自https://github.com/DV8FromTheWorld/JDAhttps://mvnrepository.com/artifact/net.dv8tion/JDA/5.0.0-alpha.3

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.3</version>
</dependency>
于 2021-12-30T19:33:17.607 回答