0% found this document useful (0 votes)
6 views

Devops Experiment -1

This document provides an introduction to build automation tools, specifically Maven and Gradle, highlighting their key differences, installation steps, and setup procedures. It emphasizes the advantages of using build automation for software development, such as consistency and efficiency, and outlines the specific features of both tools. Additionally, it includes assessment questions to reinforce understanding of the material covered.

Uploaded by

shubhashreenj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Devops Experiment -1

This document provides an introduction to build automation tools, specifically Maven and Gradle, highlighting their key differences, installation steps, and setup procedures. It emphasizes the advantages of using build automation for software development, such as consistency and efficiency, and outlines the specific features of both tools. Additionally, it includes assessment questions to reinforce understanding of the material covered.

Uploaded by

shubhashreenj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment 1: Introduction to Maven and Gradle

Introduction to Maven and Gradle: Overview of Build Automation Tools, Key Differences Between
Maven and Gradle, Installation and Setup

Objective

To understand build automation tools, compare Maven and Gradle, and set up both tools for software
development.

1. Overview of Build Automation Tools

Build automation tools simplify the process of compiling, testing, packaging, and deploying software
projects. They manage dependencies, execute tasks, and integrate seamlessly with Cl/CD pipelines.

Why Use Build Automation?

mEnsures consistency across builds


el Handles dependency management automatically
LI Reduces manual errors and increases efficiency
rd Integrates with tools like Jenkins & Azure DevOps
Popular Build Automation Tools

Apache Ant ➔ Script-based, manual dependency~management


Apache Maven ➔ XML-based, convention-over-configuration model
Gradle ➔ Flexible, fast, and supports Groovy/Kotlin DSL

2. Key Differences Between Maven and Gradle


,.. ~ It - "\A l ~ y ,,.. 9t ~ w
J.!· It ~ ~
Feature "° 'U' -~~en 'XMt) U R " i f it ~ w ii'i. • Gradle (Groovy/Katlin)

' : build.gradle / build.gradle.kts


'.Build Script pot1.><11l

, Performance Sequential, slower Parallel execution, faster

, Flexibility Convention-based ; Highly customizable

Dependency Mgmt. Uses Maven Repository Supports multiple repositories

Ease of Use Simple XML structure Slightly complex but powerful

' Caching Support No build caching Supports Incremental builds

Best For Standard Java projects Complex, high-performance builds

Maven is great for structured, enterprise-level projects.


Gradle is ideal for scalable and performance-driven applications.

3. Installation and Setup

e 3.1 Installing Maven


la Step 1: Install Java (JDK 17 Recommended)

PREPARED BY: SHARATH BABU S



Check if Java is installed:

l j ava -version
-~ j avac -version

Bi Step 2: Download and lnstail Maven


Download from: Download Apache Maven - Maven
Extract it to a folder (e.g., C:\Maven ).

LI Step 3: Configure Environment Variables


Windows:

Add MAVEN_HOME ➔ C:\Maven\apache-maven-<version>


Add M2_HOME ➔ C:\Maven\apache-maven-<version>
Update Path ➔ %MAVEN_HOME%\bin
-
LI Step 4: Verify Installation
Run:

.J. mvn -version


2.

Expected Output:

1 Apache Haven 3.x.x


.... ',
..,2.
<,'.
Haven home: C:\l1aven\apache-maven-<Version>
3 Java version: 17.0.4

3.2 Installing Gradle

f2 Step 1: Install Java (JDK 17 Recommended)


Same steps as Maven.

LI Step 2: Download and Install Gradle


Download from: Gradle I Releases
Extract it to a folder (e.g., C:\Gradle ).

LI Step 3: Configure Environment Variables


Windows:

Add GRADLE_HOME ➔ C:\Gradle\gradle-<version>


Update Path ➔ %GRADLE_HOME%\bin

PREPARED BY: SHARATH BABU S


II
I I

I •

If I I

l'J Step 4: Verify Installation


Run:

1 gradle -v
2

Expe cted Outp ut:

1 Gradle 8.x
2 Build time: YYYY-MM-DD HH:'1'1:SS
3 Kotlin: X.Y
4 Groovy: X. Y
5

Assessment Questions
1. Wha t are the key advantages of using
a build automation tool?
2. Ment ion three majo r differences betw
een Maven and Gradle.
3. How does Gradle achieve faster build
times compared to Maven?
4. Wha t are the necessary environment
variables for setting up Maven and Gradle?
5. How do you verify that Maven and Grad
le are installed correctly?

PREPARED BY: SHARATH BABU S

You might also like