1.15.2 Craftbukkit and Spigot API conflicting maven

Discussion in 'Spigot Plugin Development' started by KotoriXIII, Mar 10, 2020.

  1. Hi, the IDE I am using is IntelliJ and I am working on a Maven project right now. I tried importing both spigot-api-1.15.2-R0.1-SNAPSHOT-shaded.jar and craftbukkit1.15.2 into my library as shown in the image below. The imports work and they are defined in my local repository, however, IntelliJ keeps showing me errors in the code.

    It is to my understanding that two dependencies having the same object definition can clash. That's the first thing that came to mind when I received this error.

    The Spigot API shows that this is a valid method and the import was visible. I tried importing it and it even showed at the top of my project that it was imported. More specifically: org.bukkit.entity.player.spigot but it still wasn't working. The next thing I wondered was if craftbukkit was conflicting with it. I removed craftbukkit and it started working. But now the player definition in the image above wasn't working since CraftPlayer wasn't defined.

    What am I doing wrong?

    EDIT: I have solved the problem temporarily by shading craftbukkit hence adding it to my library.
    I would still like to understand why this problem arises though.
    #1 KotoriXIII, Mar 10, 2020
    Last edited: Mar 11, 2020