Solved Maven Modules

Discussion in 'Spigot Plugin Development' started by 7rory768, Mar 31, 2020.

Thread Status:
Not open for further replies.
  1. So I've set up maven modules to allow abstraction in my plugin and for some reason my Plugin module (whilst depending on my API module) doesn't recognize the interface WanderRemover. I cant figure out why.

    upload_2020-3-31_15-53-28.png

    parent pom: https://pastebin.com/nRbMA2c6
    RPGHorsesPlugin pom: https://pastebin.com/CAD1Wrkv
    API pom: https://pastebin.com/cpmbRwsG
    1_12_2 pom: https://pastebin.com/MG0FNBPY
    1_11_2 pom: https://pastebin.com/SwnizP2y

    mvn install output:
    Code (Text):
    [INFO] 2 errors
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] RPGHorses .......................................... SUCCESS [  0.443 s]
    [INFO] API ................................................ SUCCESS [  1.099 s]
    [INFO] 1_11_2 ............................................. SUCCESS [  2.379 s]
    [INFO] 1_12_2 ............................................. SUCCESS [  3.992 s]
    [INFO] RPGHorsesPlugin .................................... FAILURE [  0.715 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 8.698 s
    [INFO] Finished at: 2020-03-31T15:58:21-06:00
    [INFO] Final Memory: 38M/987M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project RPGHorsesPlugin: Compilation failure: Compilation failure:
    [ERROR] /D:/Files/Coding/IntellJ Projects/Minecraft Development/Public Plugins/RPGHorses/RPGHorses/RPGHorsesPlugin/src/main/java/org/plugins/rpghorses/RPGHorsesMain.java:[23,24] cannot find symbol
    [ERROR] symbol:   class WanderRemover
    [ERROR] location: class org.plugins.rpghorses.RPGHorsesMain
    [ERROR] /D:/Files/Coding/IntellJ Projects/Minecraft Development/Public Plugins/RPGHorses/RPGHorses/RPGHorsesPlugin/src/main/java/org/plugins/rpghorses/RPGHorsesMain.java:[44,23] cannot find symbol
    [ERROR] symbol:   class WanderRemover
    [ERROR] location: class org.plugins.rpghorses.RPGHorsesMain
     
    EDIT:
    Solution:
     
    #1 7rory768, Mar 31, 2020
    Last edited: Mar 31, 2020
  2. In order to use "WanderRemover" from the API, you must import the appropriate classes. The object type doesn't exist. Add the RPGHorses API as a dependency the same way you do with Spigot and then try again.
     
  3. ... yes of course... the problem is there is no import for it. If it were that simple I wouldn't have an issue.

    upload_2020-3-31_16-4-54.png
     
  4. Have you added your other project as a dependency?
     
  5. md_5

    Administrator Developer

    WanderererRemover doesn't have a package in your API project. Put it inside the correct package
     
  6. I knew it was probably something silly, thank you!
     
Thread Status:
Not open for further replies.