Maven and Gradle
In short: Maven and Gradle are the common build tools for Java: they fetch dependencies, compile, test and package the project.
In more detail: Maven describes the project declaratively in a pom.xml, Gradle in a script (Groovy or Kotlin) that is more flexible.
In Depth
- Maven: Fixed lifecycles (
compile,test,package,install) and a standard folder layout (src/main/java). Dependencies with coordinatesgroup:artifact:versionfrom Maven Central, including transitive ones. - Gradle: Task graph, incremental builds, build cache and daemon usually make it faster. Standard on Android.
- Wrapper:
mvnwandgradlewdownload the right tool version themselves so everyone builds the same. - Commands:
mvn clean package,gradle build,gradle test. - Dependency conflicts:
mvn dependency:treeandgradle dependenciesshow where a version comes from. - Choice: Maven for simplicity and uniformity, Gradle for large or unusual builds.