Junior — Middle
What build automation systems have you been familiar with or used in practice?
sobes.tech AI
Answer from AI
The most commonly used build automation systems in Java projects are:
- Maven — a declarative build system that uses the pom.xml file to manage dependencies and the project lifecycle.
- Gradle — a more flexible and modern system that uses scripts written in Groovy or Kotlin DSL.
- Ant — an older tool based on XML scripts, often used in inherited projects.
Example of using Maven to build a project:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- dependencies -->
</dependencies>
</project>
Gradle allows writing scripts in Kotlin DSL:
tasks.register("hello") {
doLast {
println("Hello, Gradle!")
}
}
The choice of system depends on the project requirements and team preferences.