Search code examples
javamavenbukkit

Maven CycleException


I am currently making a library for my upcoming spigot plugins. But you won't require any knowledge of that since this is more dependent on maven issues

So firstly I'd like to give the source

I have multiple modules: Library, v1_13_R1, v1_13_R2, the reason for multiple v1_13_R etc. is because Maven won't allow you to implement multiple versions of the same dependency. And its crucial for the functions of these modules to have the right version as the packages have the version names in them. EDIT 1 I've seen that this may sound confusing so: The reason why its possible to have multiple of the same library in one jar(Not module) is possible because my system won't initiate the class containing imports that aren't provided as I first detect which version is used. This way I can make it multi-version. I hope this clears up some of the confusing regarding this.

So if I clean package from root then It will create 3 jars, but none of them contains all 3 modules, which is what I need. And if I make the version dependent modules a dependency in my Library module, then I'll get a CycleException.

1) any idea on how to fix this?

or optionally:

2) is there any better project structure possible?

Any help would be really appreciated, thanks in advance

EDIT I still need a good answer as its frustrating me at the moment since nothing works. So if you have any knowledge on how to make such a project structure work please tell me.


Solution

  • So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib

    I hope this works for everyone!