Maven can't import CraftPlayer, Packets

Discussion in 'Spigot Plugin Development' started by HakanGaming, May 1, 2017.

  1. Hi, I made maven projects but I can't import packets. Please help me:

    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>io.github.hakangulgen</groupId>
        <artifactId>TRGLobi</artifactId>
        <version>1.0.0</version>

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        <!-- Repositories -->
        <repositories>
            <repository>
                <id>spigot-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
            </repository>
        </repositories>
        <!-- Dependencies -->
        <dependencies>
            <!-- Spigot 1.8.8-R0.1-SNAPSHOT -->
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
            </dependency>
        </dependencies>
        <!-- Build -->
        <build>
            <finalName>${project.name}</finalName>
            <defaultGoal>clean install</defaultGoal>
            <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
            <resources>
                <resource>
                    <directory>${project.basedir}/src/main/resources</directory>
                    <targetPath>.</targetPath>
                    <filtering>true</filtering>
                    <includes>
                        <include>plugin.yml</include>
                    </includes>
                </resource>
            </resources>
        </build>
    </project>
     
  2. NathanWolf

    Supporter

    That's because you're only including the API, you'll need all of spigot to get NMS classes. You'll also need to add spigot to your local Maven repo then, though running BuildTools on your dev machine should be enough to make that happen.
     
  3. How to I can add spigot to my local maven repo? (I'm new in maven :/)
     
  4. Run BuildTools. That will install it into local maven repo.