I have a special project structure:
root project
+ sub project 1
+ sub project 2
The subprojects are represent "plugins": part of the application built into separated jar and scanned dynamicly by root project at run time when deployed. (There may be additional subprojects added to the deployment, developed separately.) An other twist is that the subprojects depends (compile, or more precisely edit time) on the root project (the root project contains a DSL and the subprojects defines scripts on this DSL, so dependency is required only for syntax and cotext help).
In the gradle build I have a release and deploy task which includes all three projects build result (jars) into one zip to be deployed. So as standalone app, it works fine.
However, when I try to run the root project, it can't access the jars of the subprojects, because to avoid circular references I can't make root to depend on the subprojects.
What is the best practice to make the app to build, run and detect plugins while running in IDEA, while keeping the loose coupling on gradle level?
Some ideas I thought:
1) Somehow extend or configure the build task of the gradle script of the root project to depend on and include subprojects. (Could I without establishing a circular reference?)
2) Somehow add additional project configuration to the IDEA project. Could it be done without being removed with each gradle script reparse?
3) Make IDEA to include the build results of the subprojects in runtime environment.
Is there a best practice?