Java › Build Tools: Maven & Gradle
What problem do build tools like Maven and Gradle solve for a Java project?
BeginnerAnswer
Build tools automate compiling source code, managing external library dependencies (downloading and resolving version conflicts automatically), running tests, packaging the application (into a JAR/WAR), and orchestrating multi-step build lifecycles consistently across every developer's machine and CI server -- without one, developers would need to manually track and download dependency JARs, manually invoke javac with correct classpaths, and manually script packaging, all error-prone and inconsistent across environments.
<!-- pom.xml -- Maven declares a dependency, and Maven handles downloading it and its own transitive dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>Real-world example A team onboarding a new developer has them simply run `mvn clean install`, which automatically downloads all required dependencies, compiles the code, runs tests, and produces a runnable JAR -- entirely reproducible without the new developer needing to manually hunt down and configure dozens of library JARs by hand.