0

I was programming a Discord Bot using JDA (I was using the 5.0.0-alpha.22). Now I wanted to use the latest version due to some incompatibilities. As far as I know you only need to change the version in the .xml file but it says that the dependency could not be found.

<?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>de.jurassic</groupId>
    <artifactId>NekoBot</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>dv8tion</id>
            <name>m2-dv8tion</name>
            <url>https://m2.dv8tion.net/releases</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>5.0.0-beta.2</version>
        </dependency>
    </dependencies>
</project>

Do I need to change other things to use a different version?

  • You can remove the repositories part, since its now hosted on maven central. Your issue is likely just the IDE needing to [refresh](https://stackoverflow.com/questions/9980869/force-intellij-idea-to-reread-all-maven-dependencies). – Minn Dec 29 '22 at 12:34
  • That was the solution. Thank you very much! – Jurassic Dec 29 '22 at 13:44

1 Answers1

0
<dependency>
   <groupId>com.github.DV8FromTheWorld</groupId>
   <artifactId>JDA</artifactId>
   <version>VERSION HERE</version>
</dependency>

Remember to double check the groupId ;)

ohSavee
  • 1
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 29 '23 at 01:35