I am having a heck of a time getting a fresh single-project build working with Gradle. I am only a part-time Java dev, and I have mostly worked with multi-project builds. Iβm not expert, but I can work with them.
The other day I was struggling to bootstrap a single project build (Gradle 7), using only a single build.gradle at the project level, and a single src folder at the root level with my code.
What am I missing? It seems to be unable to fetch the required dependencies. All the examples I see in the docs are for multi-project builds.
Multi- or Singleproject do not really make any difference.
A Singleproject build is just a Multiproject build with only one project, nothing more.
What you might have done wrong is hard to guess, as you shared no information at all.
Neither what you have in your build script, nor the concrete error message you get when you do what, nor a build --scan.
classpath
No dependencies
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 925ms
1 actionable task: 1 executed
With no actual build folder created. What did I miss?
gradle.build is not a file Gradle cares about.
=> you have no build script
=> you end up effectively with an empty build script
What you meant is build.gradle.
But I highly recommend build.gradle.kts. The Kotlin DSL by now is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.