DiscordSRV

DiscordSRV

86.8k Downloads

Transitive dependencies not resolving when jcenter & nexus.vankka.dev aren't explicitly defined

Andre601 opened this issue ยท 6 comments

commented

The section Developers on the main Wiki page is incomplete.
It only mentions to install DiscordSRV through its nexus, but misses the fact, that you also need to add jcenter as a repository for DiscordSRV to be able to download JDA as a passthrough dependency.

Looking at the ApiTest's pom.xml could this in fact be an unintentional bug?

Edit: This is also an issue with MCDiscordReserializer

commented

Took the excact version information repository from that wiki page, threw it into maven (3.6.3) & gradle (6.3) and both retrieved the main project & all dependencies fine.
The pom for DiscordSRV's artifact contains these repositories, so maven should be able to resolve them from there, https://nexus.scarsz.me/service/local/repositories/releases/content/com/discordsrv/discordsrv/1.19.1/discordsrv-1.19.1.pom

EDIT: Only using nexus.scarsz.me & maven central (and maven local repository removed during the maven test)

commented

Took the excact version information from that wiki page, threw it into maven (3.6.3) & gradle (6.3) and both retrieved the main project & all dependencies fine.
The pom for DiscordSRV's artifact contains these repositories, so maven should be able to resolve them from there, https://nexus.scarsz.me/service/local/repositories/releases/content/com/discordsrv/discordsrv/1.19.1/discordsrv-1.19.1.pom

Did you make sure it's actually not your local cache that resolves this?
I had those exact issues where Gradle (5.5) complains about JDA not being found and required by DiscordSRV and MCDiscordReserializer not being found and required by DiscordSRV.

I do have mavenCentral() set as a repository.

The full build.gradle I use
https://paste.helpch.at/axucurekux.cs

commented

Did you make sure it's actually not your local cache that resolves this?

Yes, I reran the tests with the .m2 and global .gradle/caches, project .gradle folders renamed (+ gradle didn't even have mavenLocal() as a repository)

build.gradle

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url 'https://nexus.scarsz.me/content/groups/public/' }
}

dependencies {
    compileOnly 'com.discordsrv:discordsrv:1.19.1'
}

pom.xml

<?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>org.example</groupId>
    <artifactId>testproject-maven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <repositories>
        <repository>
            <id>Scarsz-Nexus</id>
            <url>https://nexus.scarsz.me/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.discordsrv</groupId>
            <artifactId>discordsrv</artifactId>
            <version>1.19.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>

EDIT: also tested building DiscordSRV-ApiTest, which also succeeded (after downloading all dependencies to the cache)

commented

Maybe a version-dependand issue, since you use 6.3 and I use 5.5

commented

Updated the last comment, going to point out that we have had other people having this same issue, not entirely sure what's causing this

commented

Closing this for inactivity & unable to reproduce