DecentHolograms icon indicating copy to clipboard operation
DecentHolograms copied to clipboard

Could not find artifact de.tr7zw:item-nbt-api:pom:2.12.1 in spigot-repo

Open BuggyAl opened this issue 2 years ago • 9 comments
trafficstars

Just making sure

  • [X] I made sure, this bug is not already known or reported.
  • [X] I believe, that this bug is fixable.

Reproduction

  1. Add Jitpack and DecentHolograms 2.8.5 to pom.xml
  2. Update the Maven Project
  3. Observe as it fails to find item-nbt-api Could not find artifact de.tr7zw:item-nbt-api:pom:2.12.1 in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

Solution

The dependency is probably trying to pull the NBT API from the incorrect repository. Either that or I don't know how to use Maven properly. image

Server Version

git-Paper-280 (MC: 1.20.2)

Client Version

1.20.2

Plugin Version

2.8.5

Log

Not a server issue.

BuggyAl avatar Nov 19 '23 17:11 BuggyAl

Looking through the commit history, it appears that commit https://github.com/DecentSoftware-eu/DecentHolograms/commit/c5d62ac7c5e4104a3f5c860be3642beacf8b5bc7 is the culprit... I'm assuming changeme means something needs to be changed... (de.tr7zw.changeme.nbtapi build.gradle line 64)

BuggyAl avatar Nov 19 '23 20:11 BuggyAl

Hello, that commit is definitely not the problem. That is the actual package in NBTAPI see this. Could you show me your pom.xml file?

d0by1 avatar Nov 19 '23 23:11 d0by1

<?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>me.buggyal</groupId>
    <artifactId>SoulQuest</artifactId>
    <version>0.12</version>
    <packaging>jar</packaging>

    <name>SoulQuest</name>

    <description>The official SoulQuest plugin.</description>
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
                    <relocations>
                        <relocation>
                            <pattern>com.github.stefvanschie.inventoryframework</pattern>
                            <shadedPattern>me.buggyal.soulquest.inventoryframework</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <finalName>SoulQuest</finalName>
                    <outputDirectory>C:\Users\BuggyAl\Desktop\Servers\SoulQuest\plugins</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>citizens-repo</id>
            <url>https://maven.citizensnpcs.co/repo</url>
        </repository>
        <repository>
            <id>sk89q-repo</id>
            <url>https://maven.enginehub.org/repo/</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.20.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.10.2</version>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-sync</artifactId>
            <version>4.10.2</version>
        </dependency>
        <dependency>
            <groupId>com.sk89q.worldguard</groupId>
            <artifactId>worldguard-bukkit</artifactId>
            <version>7.1.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.citizensnpcs</groupId>
            <artifactId>citizens-main</artifactId>
            <version>2.0.33-SNAPSHOT</version>
            <type>jar</type>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.stefvanschie.inventoryframework</groupId>
            <artifactId>IF</artifactId>
            <version>0.10.12</version>
        </dependency>
        <dependency>
            <groupId>net.luckperms</groupId>
            <artifactId>api</artifactId>
            <version>5.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.decentsoftware-eu</groupId>
            <artifactId>decentholograms</artifactId>
            <version>2.8.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>24.0.1</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>

BuggyAl avatar Nov 19 '23 23:11 BuggyAl

Issue was solved after updating my Maven repos.

BuggyAl avatar Dec 03 '23 14:12 BuggyAl

Never mind, issue popped up again...

BuggyAl avatar Dec 03 '23 14:12 BuggyAl

I had the same issue. The problem is that the Item-NBT-API is not contained in the maven repository https://jitpack.io

To solve this issue you need to import the repository from Item NBT API as well which is listed recommend in the Item NBT API Wiki: https://github.com/tr7zw/Item-NBT-API/wiki/Using-Maven

Right now it's the codemc repo:

<!-- ItemNBT -->
<repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.io/repository/maven-public/</url>
    <layout>default</layout>
</repository>

So it should be stated in the DecentHolograms wiki to use the jitpack.io AND the codemc repository. With jitpack.io only it wont be able to find the Item NBT API.

MineFact avatar Dec 05 '23 13:12 MineFact

The problem here is that this shouldn't be necessary at all. DH shades and relocates the library into itself, meaning it should be included without any extra repositories to be declared... Having this issue makes no sense at all...

My best guess is that jitpack here messes with things somehow... declaring a dependency as needed even tho it is included by the build logic of DH...

Andre601 avatar Dec 05 '23 14:12 Andre601

Why not adding the codemc repository to the wiki until you found out what is causing the problem? Right now people are not able to use the API and have to find the solution themselves... This way they could at least use the API in their code.

MineFact avatar Dec 05 '23 14:12 MineFact

Right now only d0by has direct write access to the wiki... I would love to update it, but I have to wait for him to merge any PRs I made...

Andre601 avatar Dec 05 '23 14:12 Andre601

This has been added to the wiki here so I consider this resolved and will close this issue. If you have any other problems or questions, feel free to create a new issue.

d0by1 avatar May 21 '24 15:05 d0by1