When trying to create a gradle project in eclipse, the source folder, build.gradle and others are stored in a different folder called lib as a separate project. How can I make all the folders be within the project folder like in a normal java project?
The problem is that the New Gradle Project dialog invokes the Gradle init
task with the hard-coded argument --type java-library
and that the project layout for Gradle versions higher than 6.6.1 has a lib
folder besides the main project folder for a project of the type java-library
(in contrast to in Gradle 6.6.1 or lower and in contrast to a project of the type application
independent of the Gradle version).
In the future, in the New Gradle Project dialog, the type application
should also be chooseable, to get a simple project structure like in the past. But this is not implemented yet:
Eclipse Buildship issue #1118: Add more project templates to New Gradle Project wizard
As a workaround do the following:
build.gradle
change id 'java-library'
to id 'application'
The last two steps are only required to use a Gradle version higher than 6.6.1.