In this post we will look at a basic introduction to build tools and a few distinguishing factors between widely used build tools.
What are build tools?
Build Tools are programs that create executables from source code. The build tool facilitate in
- Downloading and linking dependencies.
- Compiling the source code
- Running unit test cases (if any)
- Packaging the source code into executables (.jar, .exe etc)
- Deploy to production.
Why do we need Build Tools?
Developers can perform these activities manually in a small application. But as the application scales, it becomes rather cumbersome to perform these activities manually. In certain larger applications, we need to specify the flow of module. Such rules can be defined in Build Tools. Scripts can be written to automate the above steps using Build Tools to avoid manual effort by developers.
Examples of Build Tools
The most widely used Build Tools are:
Build Tool Installations
Advantages and Disadvantages of Gradle over Maven.
- Simple to configure.
- Groovy makes scripting easy and readable.
- Dynamic dependency set
- Works with Maven Repositories as well
- Defining sequence of execution is easy.
- In a multi-module project or micro service architecture, defining incremental build is straight forward.
- As claimed on the official website, Gradle is faster than maven.
- Not as many plugins available as for Maven
- Learning curve is hight for Groovy
- Poor integration with Eclipse
- Slower than Maven
Using Maven or Gradle is a personal choice and the type of project you have. Setting up either of them can be as simple or as pains taking as you can imagine. In my future posts, you will see me working with Gradle extensively.