Since some Gradle version, it doesn't create "flat projects" any more. Instead you always get an empty "wrapper" project with the actual project name ("myproject") which includes a sub project always named lib
or app
, depending on whether you choose --type java-library
or --type java-application
. The sub project, e.g. lib
, is the "actual" project / module.
For my application I maintain a framework, let's say "my_framework" which contains a lot of sub projects "database", "config", "webhelp", ... These sub projects directly contain the code. I include
them in the settings.gradle
file like my_framework:database
. This structure was created a few years ago using Eclipse and the Gradle version of that time.
Now, when I try to add more sub projects, I will get an empty wrapper project with the intended name (e.g. stats2json
) and another nested sub project always named lib
. I will have to include my_framework:database:lib
.
This makes the project tree in Eclipse more unclear and I do not really understand this change. Did I do something wrong some years ago? Or is the mandatory lib
/app
sub project, I'm dealing with currently, result of a wrong approach?
Is there gradle init --type java-library-**subproject**
?
I use the current Eclipse version and Gradle 7.x. I tried to create new sub projects (1) using Eclipse's "new gradle project" wizard and (2) using the command line gradle
in a manually created empty sub project directory. But results are the same.