I have 3 projects: shared1, shared2, app1 and app2.
Now when I build them, I get 4 individual JARs. But I want app1 and app2 (which both depend on shared1 and shared2) to work standalone.
I know that I could merge the JAR files, but seems fragile. I’d rather somehow have Gradle build app1 by using the source directories of shared1, shared2 and app1.
The problem was that when I created an IDEA project it didn’t really work, since IntelliJ was saying the source directory was “outside of the content root”.
So could I somehow just keep the regular configuration for IDEA and only when I want to publish something, bundle the source directories?
One problem now is that the generated POM of “app1” contains the dependency “shared1”, but I’d rather have it contain all dependencies of “shared1” directly (“flattened”).
I tried adding the project’s dependencies manually:
Currently as a workaround I created a list of the dependencies (“libraries”) and added them manually. EDIT: And the source directories are also in a list (“moduleDirs”)