Back-end programming


Build process

Build process

  1. Translate the human-readable source code into a machine-executable program
  2. Creating the application binaries for a software release

Java Build process Tools


What is maven?

Maven is a tool that can now be used for building and managing any Java-based project. 


Maven provides tools to:

  • Facilitate and uniformize the build process
  • Provide quality project documentation
  • Manage project dependencies efficiently

Convention over configuration

A manual build process, or even a build process created with the ANT tool, is extensive, repetitive, and not very exciting.


With Maven, developers do not have to mention each and every configuration detail; Maven provides the default behaviour for projects.

Directory structure

Maven defines a standard directory structure so that every developer will be immediately familiar with every Maven project.

main/java - Application/Library sources

main/resources - Application/Library resources

test/java - Test sources

test/resources - Test resources

target - Build output

Project Object Model

POM is an XML file, and it's a fundamental unit of work in Maven, because it contains various informations and configuration details about the project.


Some configurations details include:

  • project organisation/group (groupID)
  • project name (artifactId)
  • project version
  • source code locations
  • dependencies
  • plugins


Extensible Markup Language (XML) is a markup language (i.e., a language that uses tags) that defines a set rules for encoding documents in a format that is readable by both machines and human beings.


XML was designed to store and transport data.

<?xml version="1.0" encoding="UTF-8"?>
  <body>Don't forget our meeting this weekend!</body>

Project Object Model

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""


Every information that isn't explicitly specified by the developer, is inherited by from the Super POM.

BUILd lifecycle

A well-defined sequence of phases, which define the order in which the goals are to be executed.

A goal is a specific task which contributes to the building and managing of a project; it may be bound to zero or more build phases.

standard BUILd lifecycle phases

We can add goals to phases by configuring the plugins in our project.

// Execute all phases up to package
$ mvn package


Tasks on Maven are executed by plugins. A plugin generally provides a set of goals.


Maven plugins are generally used to:

  • create a jar file
  • create a war file
  • compiling code files
  • unit testing the code
  • ...
// Executing a Maven goal
mvn [plugin-name]:[goal-name]


// Executing the compile goal
mvn compiler:compile


In the POM file, we can also specify what external libraries the project depends on, and Maven will download them.


But how can Maven know all of this?

Maven repository

Plugins and dependencies are loaded from remote repositories when needed.


Downloaded software is saved in a local repository for use by all maven projects.

Live coding

Environment Setup

Live Coding

Project Setup


By Soraia Veríssimo


  • 1,525