1.8.8 PlotSquared: Can't import BukkitAPI

Discussion in 'Spigot Plugin Development' started by Prixix, Jan 15, 2020.

  1. Hello,
    I'm trying to use the PlotSquared Bukkit API but I can't import it of Maven

    My pom.xml
    Code (Text):
    <?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.vaccum</groupId>
        <artifactId>VorbauSystem</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>jar</packaging>

        <name>VorbauSystem</name>

        <properties>
            <java.version>1.8</java.version>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>

        <build>
            <defaultGoal>clean package</defaultGoal>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.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.1.0</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <createDependencyReducedPom>false</createDependencyReducedPom>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
        </build>

        <repositories>
            <repository>
                <id>spigotmc-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
            </repository>
            <repository>
                <id>sonatype</id>
                <url>https://oss.sonatype.org/content/groups/public/</url>
            </repository>
            <repository>
                <id>bukkit-repo</id>
                <url>http://repo.bukkit.org/content/groups/public/</url>
            </repository>
            <repository>
                <id>p2-repo</id>
                <url>http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/</url>
            </repository>
            <repository>
                <id>sk89q</id>
                <url>http://maven.sk89q.com/repo/</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>craftbukkit</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>com.plotsquared</groupId>
                <artifactId>plotsquared-api</artifactId>
                <version>latest</version>
            </dependency>
            <dependency>
                <groupId>com.plotsquared</groupId>
                <artifactId>plotsquared-bukkitapi</artifactId>
                <version>latest</version>
            </dependency>
        </dependencies>
    </project>
     
    The error:
    Code (Text):
    Failure to find PlotSquared:Core:pom:unspecified in https://hub.spigotmc.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced

    I hope someone can help me.
     
  2. Download the jar and import it manually.
     
  3. No, don’t do this. This is not the correct way to use Maven.

    You are looking up PlotSquared:Core, which isn’t in your POM. My guess is that you need to add an exclusion for the Core artifact because one of the P2 dependencies includes it or something.

    Specify dependency scope, it’s a good practice to follow to explicitly tell Maven what you want it to do with all your dependencies.

    Get rid of the shade plugin because you don’t appear to be using it. You should not be shading the API or CraftBukkit and P2 should be a runtime-provided dependency.
     
  4. It was a joke.
     
    • Funny Funny x 1