Solved Referencing Dependancy Classes

Discussion in 'Spigot Plugin Development' started by Hunky524, May 19, 2016.

  1. I definitely know this is not a Spigot related problem, but I couldn't seem to find any google answers that solved my issue. After one of the threads posted earlier this week I know there are a decent number of IntelliJ users out there. My question is how can I have a project reference another project so I can use methods and access data from my other project. For example, if I had an economy plugin and a shop plugin, I would want the shop plugin to be able to use methods from the economy plugin through an interface so I can manage the money of all the players.
     
  2. You have to compile the code source and add it to your libraries. :)
     
    • Winner Winner x 1
  3. So there is not a way just to reference the project file in case I need to edit something quickly which would save me the trouble of having to recompile if I need to change something in the parent project?

    I's not much of an issue, I can't see myself needing to edit anything at the moment, but in case I did need to it would just be convenient.
     
  4. Idk, for this.
     
  5. If you set the export location and load the dependency from that location it will always stay updated, just make sure to recompile the dependency.
     
    • Winner Winner x 1
  6. Oh, I did not know that. It makes sense though. I'll give it a shot.
     
  7. Ding ding ding, we have a winner :)

    Xilixir's idea seems to work the best. Thanks man :)
     
  8. I'm bad because I said the same things.. Just I think you know when you recompile a file it's overriding if exists! :)
     
  9. Sorry, I didn't know that IntelliJ would automatically update the source if you recompile it from the same location. I'll give you a winner medal too though because you had the same idea :)
     
  10. Are you trying to get an instance of a dependency? In that case you have to add them as a "softdepend" dependency to make them load before your plugin, and afterwards you can get the plugin instance from the PluginManager. To have access to the classes, you can use any dependency manager, such as Maven.