NBT-API

NBT-API

98.9k Downloads

NBTAPI cannot be located by Maven

elpideus opened this issue ยท 6 comments

commented
S:\Programs\JDK\17.0.8.1\bin\java.exe -Dmaven.multiModuleProjectDirectory=S:\Documents\Development\Arleon -Djansi.passthrough=true "-Dmaven.home=S:\Programs\IntelliJ IDEA 2023.2.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=S:\Programs\IntelliJ IDEA 2023.2.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=S:\Programs\IntelliJ IDEA 2023.2.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:S:\Programs\IntelliJ IDEA 2023.2.1\lib\idea_rt.jar=52559:S:\Programs\IntelliJ IDEA 2023.2.1\bin" -Dfile.encoding=UTF-8 -classpath "S:\Programs\IntelliJ IDEA 2023.2.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.7.0.jar;S:\Programs\IntelliJ IDEA 2023.2.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2023.2.1 install
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< it.elpideus:Arleon >-------------------------
[INFO] Building Arleon 1.0.0
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Artifact com.github.tr7zw:item-nbt-api:pom:2.11.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [papermc-repo (https://repo.papermc.io/repository/maven-public/, default, releases+snapshots), sonatype (https://oss.sonatype.org/content/groups/public/, default, releases+snapshots), placeholderapi (https://repo.extendedclip.com/content/repositories/placeholderapi/, default, releases+snapshots), codemc-repo (https://repo.codemc.io/repository/maven-public/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact com.github.tr7zw:item-nbt-api:pom:2.11.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [papermc-repo (https://repo.papermc.io/repository/maven-public/, default, releases+snapshots), sonatype (https://oss.sonatype.org/content/groups/public/, default, releases+snapshots), placeholderapi (https://repo.extendedclip.com/content/repositories/placeholderapi/, default, releases+snapshots), codemc-repo (https://repo.codemc.io/repository/maven-public/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[WARNING] The POM for com.github.tr7zw:item-nbt-api:jar:2.11.3 is missing, no dependency information available
[INFO] Artifact com.github.tr7zw:item-nbt-api:jar:2.11.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [papermc-repo (https://repo.papermc.io/repository/maven-public/, default, releases+snapshots), sonatype (https://oss.sonatype.org/content/groups/public/, default, releases+snapshots), placeholderapi (https://repo.extendedclip.com/content/repositories/placeholderapi/, default, releases+snapshots), codemc-repo (https://repo.codemc.io/repository/maven-public/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] Artifact com.github.tr7zw:item-nbt-api:jar:2.11.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [papermc-repo (https://repo.papermc.io/repository/maven-public/, default, releases+snapshots), sonatype (https://oss.sonatype.org/content/groups/public/, default, releases+snapshots), placeholderapi (https://repo.extendedclip.com/content/repositories/placeholderapi/, default, releases+snapshots), codemc-repo (https://repo.codemc.io/repository/maven-public/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.295 s
[INFO] Finished at: 2023-09-15T20:51:58+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Arleon: Could not resolve dependencies for project it.elpideus:Arleon:jar:1.0.0: The following artifacts could not be resolved: com.github.tr7zw:item-nbt-api:jar:2.11.3 (present, but unavailable): com.github.tr7zw:item-nbt-api:jar:2.11.3 was not found in https://repo.papermc.io/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of papermc-repo has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1
<?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>it.elpideus</groupId>
    <artifactId>Arleon</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Arleon</name>

    <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.8.1</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>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <relocations>
                                <relocation>
                                    <pattern>de.tr7zw.changeme.nbtapi</pattern>
                                    <shadedPattern>it.elpideus.arleon.dependencies.nbtapi</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
        <repository>
            <id>codemc-repo</id>
            <url>https://repo.codemc.io/repository/maven-public/</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.tr7zw</groupId>
            <artifactId>item-nbt-api</artifactId>
            <version>2.11.3</version>
        </dependency>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>
    </dependencies>
</project>

I don't know what's wrong, really. The only way that worked was jitpack but it was buggy...

commented

Yo....you're so fast!

However this is still on.

[20:58:06 WARN]: [NBTAPI] #########################################- NBTAPI -#########################################
[20:58:06 WARN]: [NBTAPI] The NBT-API package has not been moved! This *will* cause problems with other plugins containing        
[20:58:06 WARN]: [NBTAPI] a different version of the api! Please read the guide on the plugin page on how to get the
[20:58:06 WARN]: [NBTAPI] Maven Shade plugin to relocate the api to your personal location! If you are not the developer,
[20:58:06 WARN]: [NBTAPI] please check your plugins and contact their developer, so they can fix this issue.
[20:58:06 WARN]: [NBTAPI] #########################################- NBTAPI -#########################################
commented

You need to build using maven, not using your ide. Otherwise at least from a glance

                                    <pattern>de.tr7zw.changeme.nbtapi</pattern>
                                    <shadedPattern>it.elpideus.arleon.dependencies.nbtapi</shadedPattern>

looks fine

commented

Thank you. Building from Maven works perfectly. I wonder if there's a way of doing it from inside the Intellij IDE

commented

Building with the IDE doesn't run maven plugins so no. You can just configure your ide to correctly call the maven build so you can trigger the build from the interface. Never build plugins with the IDE built-in tools.

commented

Building with the IDE doesn't run maven plugins so no. You can just configure your ide to correctly call the maven build so you can trigger the build from the interface. Never build plugins with the IDE built-in tools.

Understood. Thank you for the tip.

commented

<groupId>com.github.tr7zw</groupId> no clue where you got that from. Check out https://github.com/tr7zw/Item-NBT-API/wiki/Using-Maven#option-2-shading-the-nbt-api-into-your-plugin for the correct values.