0

I have a maven project called Editor. I have several maven projects which are plugins for this Editor (real plugins, not maven plugins). I have no real dependency between the editor and the plugins.

The editor find the plugins at runtime in the classpath by looking for annotated classes.

When I develop the editor or a specific plugin (snapshot dependency), I would like that when the editor is started it finds the plugins (up-to-date). At the moment I simply add a dependency Editor => XxxPlugins and it's fine. When I want to release the editor, I remove all these dependencies to have a clean editor.

It was fine but now I have a specific plugin that must have a dependency to the editor. It's a real dependency, I cannot just move some classes in a third maven project because the goal is really to have an editor in an Editor...

This means I have a circular dependency Editor => Plugin => Editor. The Plugin => Editor dependency is required to compile but Editor => Plugin only to be able to see the plugin when I start the project in Eclipse.

Is there a right way to manage this kind of problem?

  • I tried to change the Editor => Plugin dependency scope ("runtime", "provided", ...) but the circular dependency is still found.
  • I tried with a maven profile that add the Editor => Plugin dependency only in a dev profile. But if I set Eclipse to use the dev profile, it immediately detects the circular dependency.
  • I was thinking of maybe using a maven plugin that could copy some dependencies into a "plugin" folder, and add this folder to the classpath in Eclipse. But I don't think that when I will start the project in eclipse it will use the plugin.
Xavier M.
  • 136
  • 1
  • 7
  • 1
    The Editor does not really depends on the plugin, hence your issue. You can try adding a new "assembly/application" project, depending on both the Editor and its plugins. That new project would be the one you _launch_ in your IDE. – Tome Sep 28 '16 at 09:08
  • I think this is a great solution. I can even decide to have profiles. In the meantime I found out that I can configure the main class's run configuration to add a project in the classpath (in Eclipse). This also answers my question but your solution seems cleaner. – Xavier M. Sep 28 '16 at 16:17

0 Answers0