Maven Multiple Modules

Discussion in 'Spigot Plugin Development' started by DeKleineKobini, Jun 4, 2016.

  1. Hello,

    I'm currently making a plugin where I use NMS, I want to support multiple NMS versions without reflection.
    So I want to do this with Maven Modules, but since I don't know Maven well I did need to look up how it works and I found this, the problem is it doesn't work.
    I'm using Eclipse and this is my project.


    Code (Text):
    <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>be.kleinekobini</groupId>
        <artifactId>serverapi-parent</artifactId>
        <packaging>pom</packaging>
        <version>parent</version>
        <name>ServerAPI - Parent</name>

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>

        <modules>
            <module>API</module>
            <module>v1_9_R1</module>
            <module>v1_9_R2</module>
            <module>Plugin</module>
        </modules>

        <repositories>
            <repository>
                <id>spigot-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.9.4-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
        </dependencies>

        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
     

    Code (Text):
    <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>be.kleinekobini</groupId>
        <artifactId>serverapi-api</artifactId>
        <packaging>jar</packaging>
        <name>ServerAPI - API</name>
        <version>API</version>

        <parent>
            <groupId>be.kleinekobini</groupId>
            <artifactId>serverapi-parent</artifactId>
            <version>parent</version>
        </parent>

        <repositories>
            <repository>
                <id>spigot-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.9.4-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>

    </project>
    Code (Text):
    <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>be.kleinekobini</groupId>
        <artifactId>serverapi-v1_9_R1</artifactId>
        <packaging>jar</packaging>
        <name>ServerAPI - NMS 1.9 R1</name>
        <version>v1_9_R1</version>

        <parent>
            <groupId>be.kleinekobini</groupId>
            <artifactId>serverapi-parent</artifactId>
            <version>parent</version>
        </parent>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.9.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>be.kleinekobini</groupId>
                <artifactId>serverapi-api</artifactId>
                <version>API</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </project>
    Code (Text):
    <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>be.kleinekobini</groupId>
        <artifactId>serverapi-v1_9_R2</artifactId>
        <packaging>jar</packaging>
        <name>ServerAPI - NMS 1.9 R2</name>
        <version>v1_9_R2</version>

        <parent>
            <groupId>be.kleinekobini</groupId>
            <artifactId>serverapi-parent</artifactId>
            <version>parent</version>
        </parent>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.9.4-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>be.kleinekobini</groupId>
                <artifactId>serverapi-api</artifactId>
                <version>API</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </project>
    Code (Text):
    <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>be.kleinekobini</groupId>
        <artifactId>serverapi</artifactId>
        <packaging>jar</packaging>
        <name>ServerAPI</name>
        <version>1.0.0</version>
        <description>A general API</description>

        <parent>
            <groupId>be.kleinekobini</groupId>
            <artifactId>serverapi-parent</artifactId>
            <version>parent</version>
        </parent>

        <repositories>
            <repository>
                <id>inventive-repo</id>
                <url>http://repo.inventivetalent.org/content/groups/public/</url>
            </repository>
        </repositories>


        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.9.4-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.inventivetalent</groupId>
                <artifactId>particleapi</artifactId>
                <version>2.1.0</version>
                <scope>compile</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>be.kleinekobini</groupId>
                <artifactId>serverapi-api</artifactId>
                <version>API</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>be.kleinekobini</groupId>
                <artifactId>serverapi-v1_9_R1</artifactId>
                <version>v_1_9_R1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>be.kleinekobini</groupId>
                <artifactId>serverapi-v1_9_R2</artifactId>
                <version>v_1_9_R2</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
        </dependencies>

        <build>
            <directory>../target</directory>
            <finalName>${project.name}</finalName>
            <resources>
                <resource>
                    <directory>src/resources</directory>
                    <filtering>true</filtering>
                    <includes>
                        <include>plugin.yml</include>
                    </includes>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.4.3</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <artifactSet>
                                    <includes>
                                        <include>org.inventivetalent:particleapi</include>
                                    </includes>
                                </artifactSet>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>

    The problem is: I can use Spigot API methods.
    But in my NMS modules, the NMS methods don't show and give errors (cannot get resolved).
    And in my Plugin module the particle api doesn't work.

    -KleineKobini
     
  2. You need to use spigot as a dependency, not spigot-api, if you want NMS.
     
  3. I have that in the modules where I use NMS.
     
  4. Ah, sorry. Overlooked the spoiler.

    Have you built each version with buildtools?
     
  5. yes I have, and when I add them in my parent pom they work.
    But if I do that I can only us one NMS version.
     
  6. Could you provide:
    1) Screenshots of Eclipse errors
    2) The maven build log
    3) Whether you have any dependencies in the parent module
     
  7. 1. and 2. No, just got off my PC, can send then tomorow.
    3. Yes, I have look at the OP.

    EDIT: The errors are all CLASS cannot be resolved.
     
  8. Module: Plugin, particleapi is a depency is that module
    And most if not all errors are like this.
    Code (Text):
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Build Order:
    [INFO]
    [INFO] ServerAPI - Parent
    [INFO] ServerAPI - API
    [INFO] ServerAPI - NMS 1.9 R1
    [INFO] ServerAPI - NMS 1.9 R2
    [INFO] ServerAPI
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - Parent parent
    [INFO] ------------------------------------------------------------------------
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - API API
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-api ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\API\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-api ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-api ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\API\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-api ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-api ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-api ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - NMS 1.9 R1 v1_9_R1
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-v1_9_R1 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R1\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-v1_9_R1 ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-v1_9_R1 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R1\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-v1_9_R1 ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-v1_9_R1 ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-v1_9_R1 ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - NMS 1.9 R2 v1_9_R2
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-v1_9_R2 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R2\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-v1_9_R2 ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-v1_9_R2 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R2\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-v1_9_R2 ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-v1_9_R2 ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-v1_9_R2 ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI 1.0.0
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 1 resource
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 6 source files to D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\classes
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/emprior/spells/EmpriorEscape.java: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\main\java\be\kleinekobini\serverapi\test\wands\emprior\spells\EmpriorEscape.java uses or overrides a deprecated API.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/emprior/spells/EmpriorEscape.java: Recompile with -Xlint:deprecation for details.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/FireworkEffectPlayer.java: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\main\java\be\kleinekobini\serverapi\test\wands\FireworkEffectPlayer.java uses unchecked or unsafe operations.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/FireworkEffectPlayer.java: Recompile with -Xlint:unchecked for details.
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi ---
    [INFO] Building jar: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\ServerAPI.jar
    [INFO]
    [INFO] --- maven-shade-plugin:2.4.3:shade (default) @ serverapi ---
    [INFO] Including org.inventivetalent:particleapi:jar:2.1.0 in the shaded jar.
    [INFO] Excluding org.bukkit:craftbukkit:jar:1.9.4-R0.1-SNAPSHOT from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-api:jar:API from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-v1_9_R1:jar:v1_9_R1 from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-v1_9_R2:jar:v1_9_R2 from the shaded jar.
    [INFO] Replacing original artifact with shaded artifact.
    [INFO] Replacing D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\ServerAPI.jar with D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\serverapi-1.0.0-shaded.jar
    [INFO] Dependency-reduced POM written at: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\dependency-reduced-pom.xml
    [INFO] Dependency-reduced POM written at: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\dependency-reduced-pom.xml
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] ServerAPI - Parent ................................. SUCCESS [  0.001 s]
    [INFO] ServerAPI - API .................................... SUCCESS [  2.004 s]
    [INFO] ServerAPI - NMS 1.9 R1 ............................. SUCCESS [  0.094 s]
    [INFO] ServerAPI - NMS 1.9 R2 ............................. SUCCESS [  0.079 s]
    [INFO] ServerAPI .......................................... SUCCESS [  1.987 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.276 s
    [INFO] Finished at: 2016-06-05T09:57:18+02:00
    [INFO] Final Memory: 22M/194M
    [INFO] ------------------------------------------------------------------------
     
    Code (Text):
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Build Order:
    [INFO]
    [INFO] ServerAPI - Parent
    [INFO] ServerAPI - API
    [INFO] ServerAPI - NMS 1.9 R1
    [INFO] ServerAPI - NMS 1.9 R2
    [INFO] ServerAPI
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - Parent parent
    [INFO] ------------------------------------------------------------------------
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - API API
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-api ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\API\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-api ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-api ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\API\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-api ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-api ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-api ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - NMS 1.9 R1 v1_9_R1
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-v1_9_R1 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R1\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-v1_9_R1 ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-v1_9_R1 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R1\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-v1_9_R1 ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-v1_9_R1 ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-v1_9_R1 ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI - NMS 1.9 R2 v1_9_R2
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi-v1_9_R2 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R2\src\main\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi-v1_9_R2 ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi-v1_9_R2 ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\v1_9_R2\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi-v1_9_R2 ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi-v1_9_R2 ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi-v1_9_R2 ---
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ServerAPI 1.0.0
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ serverapi ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 1 resource
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ serverapi ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 6 source files to D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\classes
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/emprior/spells/EmpriorEscape.java: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\main\java\be\kleinekobini\serverapi\test\wands\emprior\spells\EmpriorEscape.java uses or overrides a deprecated API.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/emprior/spells/EmpriorEscape.java: Recompile with -Xlint:deprecation for details.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/FireworkEffectPlayer.java: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\main\java\be\kleinekobini\serverapi\test\wands\FireworkEffectPlayer.java uses unchecked or unsafe operations.
    [INFO] /D:/3. Minecraft/1. Plugins/1. Workspace/2. Funzcraft/ServerAPI/Plugin/src/main/java/be/kleinekobini/serverapi/test/wands/FireworkEffectPlayer.java: Recompile with -Xlint:unchecked for details.
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ serverapi ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ serverapi ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ serverapi ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ serverapi ---
    [INFO] Building jar: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\ServerAPI.jar
    [INFO]
    [INFO] --- maven-shade-plugin:2.4.3:shade (default) @ serverapi ---
    [INFO] Including org.inventivetalent:particleapi:jar:2.1.0 in the shaded jar.
    [INFO] Excluding org.bukkit:craftbukkit:jar:1.9.4-R0.1-SNAPSHOT from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-api:jar:API from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-v1_9_R1:jar:v1_9_R1 from the shaded jar.
    [INFO] Excluding be.kleinekobini:serverapi-v1_9_R2:jar:v1_9_R2 from the shaded jar.
    [INFO] Replacing original artifact with shaded artifact.
    [INFO] Replacing D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\ServerAPI.jar with D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\target\serverapi-1.0.0-shaded.jar
    [INFO] Dependency-reduced POM written at: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\dependency-reduced-pom.xml
    [INFO] Dependency-reduced POM written at: D:\3. Minecraft\1. Plugins\1. Workspace\2. Funzcraft\ServerAPI\Plugin\dependency-reduced-pom.xml
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] ServerAPI - Parent ................................. SUCCESS [  0.001 s]
    [INFO] ServerAPI - API .................................... SUCCESS [  2.004 s]
    [INFO] ServerAPI - NMS 1.9 R1 ............................. SUCCESS [  0.094 s]
    [INFO] ServerAPI - NMS 1.9 R2 ............................. SUCCESS [  0.079 s]
    [INFO] ServerAPI .......................................... SUCCESS [  1.987 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.276 s
    [INFO] Finished at: 2016-06-05T09:57:18+02:00
    [INFO] Final Memory: 22M/194M
    [INFO] ------------------------------------------------------------------------
     
    No maven build error, but have a look at this:
    Code (Text):
    @Override
        public void sendActionBar(Player player, boolean JSON, String message) {
            String json = JSON ? message : "{\"text\": \"" + message + "\"}";

            IChatBaseComponent icbc = ChatSerializer.a(json);

            PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte) 2);

            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(bar);
        }
    Code (Text):
    public void sendActionBar(Player paramPlayer, boolean paramBoolean, String paramString)
      {
        throw new Error("Unresolved compilation problems: \n\tIChatBaseComponent cannot be resolved to a type\n\tChatSerializer cannot be resolved\n\tPacketPlayOutChat cannot be resolved to a type\n\tPacketPlayOutChat cannot be resolved to a type\n\tCraftPlayer cannot be resolved to a type\n\tCraftPlayer cannot be resolved to a type\n");
      }
    This is happening in module v1_9_R1 and v1_9_R2 but I have the right depency is these modules.
     
  9. Are you sure the spigot artifact is still in the repositories? I couldn't find it ...
     
  10. You need to run buildtools, that adds the spigot artifact to your local repo (if I'm right).

    EDIT: Also, the artifacts exists because when I set them as depency in my Parent module I don't get these error.
     
  11. I see ...
     
  12. Thanks.
    I have no idea how well Eclipse handles Maven as I personally use IDEA but that does seen weird. Could you possibly send some more screenshots for establishing a baseline?

    Maybe Eclipse has a Maven plugin that makes indexing the local maven repo work better?

    Also, to confirm: The only dependencies that do not work is ParticleAPI and spigot? (spigot-api works?)
     
  13. Spigot-api works, my other dependencies don't.
    What kind of screenshots do you want?

    EDIT: Now my API does not load in my other modules. I'm considering changing to IDEA for my plugins.
     
    #13 DeKleineKobini, Jun 5, 2016
    Last edited: Jun 5, 2016