As you've noted, this is what you get from 'gradle init --type java-application'. I was happy with that behaviour too. I would rather not have the extra layer of an 'empty' parent project for simple things.
I personally feel this is an issue to be brought up with Gradle. Gradle init could have an option to make a simple, root project only, project structure. That said, the use of an 'empty' root project and a sub-project appears to be a Gradle best-practice. In fact if you don't give a project type on the command line, the prompts will explicitly ask you if you want multiple subprojects or not - if you choose yes you can have a project with an application and library as subprojects, but if you say no, you get the same structure but simply with one subproject, exactly like when you use '--type java-application' However, 'gradle init --type basic' doesn't add the 'java' plugin to the Gradle build script at all. I just tried it and the resulting build.gradle file contains only a comment. Using '--type basic' is effectively useless, all you really get from it is a settings.gradle file that sets the root project name, and it initializes the Gradle Wrapper. That's too basic to be useful. No default source folders, no plugins (not 'java' or 'application'), so there is little point. As a work-around, I would create the project, then move 'app/src' and 'app/build.gradle' up a level, delete the app folder, fix settings.gradle, and get on with my day. However, rather than fight it, I'm getting used to the idea of using an empty parent project. I just wish the 'application' plug would configure the jar manifest so I don't have to always add that manually! Regards, Scott On Mon, Jan 16, 2023 at 10:51 AM Emma Atkinson <emma.atkins...@gmail.com> wrote: > I'm not sure if this is a bug or intended functionality. > > If I want to create a simple Java SE application Gradle project I do the > following: > Select New Project > Select Java with Gradle > Select *Java Application *for a simple application > Click the Next button > Enter a project name > Click the Finish button > > However, this creates a multi-project application with a single subproject > called *app*. One has to change this default name to something > meaningful by hand. There is no refactoring support that I could find to > rename the subproject. > > This is equivalent to > *> gradle init --type java-application* > > NB IDE 16 has a better way to create a multi-project with a single > subproject if that is what one wants: just select *Multi-Project Build* > instead of *Java Application* , which allows one to give one or more > subprojects and give them sensible names. > > According to the Gradle 6.7 Release Notes, where this behaviour was first > released, if one wants to create a simple Java SE project in NB IDE 16 > selecting Java Application should use the *basic *project type equivalent > to: > *> gradle init --type basic* > > Do you agree or am I missing something? > > > *References* > Gradle 6.7 introduced this behaviour. Documentation for the build init > plugin may be found at > https://docs.gradle.org/6.7/userguide/build_init_plugin.html > > The release notes may be found at > https://docs.gradle.org/6.7/release-notes.html. The release notes say to > use project type *basic* if one does not need the complexity of a > multi-project build. > > Regards > >