Solved Maven Compile Error

Discussion in 'Plugin Development' started by thepaperboy99, Nov 17, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    thepaperboy99

    Hello bukkit, I finally got maven to work to compile plugins and everything, then when I tried to compile a plugin that has code with packets, it says that it does not exist.

    pom.xml:

    Code:
    <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.thepaperboy99</groupId>
      <artifactId>_FFATest2</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <name>FFA</name>
      <description>dsad</description>
     
        <!-- Repositories -->
        <repositories>
            <repository>
                <id>bukkit-repo</id>
                <url>http://repo.bukkit.org/content/groups/public</url>
            </repository>
            <repository>
                <id>sk89q</id>
                <url>http://maven.sk89q.com/repo/</url>
            </repository>
        </repositories>
     
        <!-- Dependencies -->
        <dependencies>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>LATEST</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.sk89q</groupId>
                <artifactId>worldedit</artifactId>
                <version>5.5.7-SNAPSHOT</version>
            </dependency>
        </dependencies>
     
        <!-- Build settings -->
        <build>
            <finalName>${project.name}</finalName>
            <defaultGoal>clean package</defaultGoal>
     
            <!-- Resources -->
            <resources>
                <resource>
                    <targetPath>.</targetPath>
                    <directory>${basedir}/src/main/resources/</directory>
                    <filtering>true</filtering>
                    <includes>
                        <include>*.yml</include>
                        <include>*.dat</include>
                    </includes>
                </resource>
            </resources>
     
            <!-- Plugins -->
            <plugins>
                <!-- Compiler -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    The import that it cannot find: import net.minecraft.server.v1_6_R3.Packet205ClientCommand;

    Error:

    Code:
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] bootstrap class path not set in conjunction with -source 1.6
    C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\freeforall\l
    isteners\DeathEvent.java:[12,35] error: package net.minecraft.server.v1_6_R3 doe
    s not exist
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[17,44] error: package org.bukkit.craftbukkit.v
    1_6_R3.entity does not exist
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[145,11] error: cannot find symbol
    [ERROR]  symbol: class Packet205ClientCommand
    C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\freeforall\l
    isteners\DeathEvent.java:[145,47] error: cannot find symbol
    [ERROR]  symbol: class Packet205ClientCommand
    C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\freeforall\l
    isteners\DeathEvent.java:[147,13] error: cannot find symbol
    [INFO] 5 errors
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.003s
    [INFO] Finished at: Sun Nov 17 11:44:26 PST 2013
    [INFO] Final Memory: 11M/106M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
    4:compile (default-compile) on project freeforall: Compilation failure: Compilat
    ion failure:
    [ERROR] bootstrap class path not set in conjunction with -source 1.6
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[12,35] error: package net.minecraft.server.v1_
    6_R3 does not exist
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[17,44] error: package org.bukkit.craftbukkit.v
    1_6_R3.entity does not exist
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[145,11] error: cannot find symbol
    [ERROR] symbol: class Packet205ClientCommand
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[145,47] error: cannot find symbol
    [ERROR] symbol: class Packet205ClientCommand
    [ERROR] C:\Users\User\workspace\FreeForAll\src\main\java\me\thepaperboy99\free
    forall\listeners\DeathEvent.java:[147,13] error: cannot find symbol
    [ERROR] -> [Help 1]
    My code:

    Code:java
    1. public void forceRespawnPlayer(final Player player){
    2. Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
    3.  
    4. @Override
    5. public void run() {
    6. Packet205ClientCommand packet = new Packet205ClientCommand();
    7. packet.a = 1;
    8. ((CraftPlayer)player).getHandle().playerConnection.a(packet);
    9.  
    10. }
    11. }, 2L);
    12. }



    Is there anyway to compile a plugin with maven, and use packet code in your plugin? Thanks

    P.S If you need more info, just ask :)
     
  2. Offline

    xTrollxDudex

  3. Offline

    thepaperboy99


    Do you know craftbukkit's dependency? I tried to Google it and cant find it, unless I'm doing something wrong. lol
     
  4. Offline

    xTrollxDudex

    thepaperboy99
    I remember it's the same as bukkit's dependency except with a craftbukkit artifactId. Not sure, let me get on my computer later, I have to go soon. Look on repo.bukkit.org, look up "CraftBukkit" in the search bar on the left and look at the pom
     
    thepaperboy99 likes this.
  5. Offline

    thepaperboy99


    Found it, Thank you so much! :)
     
Thread Status:
Not open for further replies.

Share This Page