Justin G.
Justin G.

Reputation: 11

Maven dependency without cycling?

I'm a Java programer, and wanted to make a Bukkit/Spigot Plugin (Minecraft Based) but this doesnt matter at the moment.

I Got a Problem with maven, i tried to make a moba like game, and i tought it would be useful lto split the project in multiple parts (a Heros Module, Game Logic Module ...), so this worked well. Then i looked how to make a uber Jar and i should make a Custom Module, add maven shade to it, and it would be done (it is).

But now i got the Problem in Module 1 (Init Module) is a instance of the class (a static variable), and i need to access it from Module 2 (the Game Logic), but also Module 1 (Init Module), need to start the Timers from Module 2 (the Game Logic).

So i Stuck at this, i'm new with maven, and the reason why i wanted to use it was an easier dependency management and the possibility to make different modules and put them together in 1 jar.

Upvotes: 0

Views: 85

Answers (1)

glee8e
glee8e

Reputation: 6419

Dependency structure should be a Directed acyclic graph. That is, in most cases, a cycle should be considered a bug.You should probably refactor your project. Most probably, move that timer in your Game Logic into the init module, or just create a new module called common, and let init and game logic depend on the common module.

Upvotes: 1

Related Questions