eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Reactive – NPI EA (cat=Reactive)
announcement - icon

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – LS – NPI EA (cat=Jackson)
announcement - icon

Get started with Spring and Spring Boot, through the Learn Spring course:

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

>> The New “REST With Spring Boot”

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth, to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project.

You can explore the course here:

>> Learn Spring Security

Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot.

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – LJB – NPI EA (cat = Core Java)
announcement - icon

Code your way through and build up a solid, practical foundation of Java:

>> Learn Java Basics

Partner – LambdaTest – NPI EA (cat= Testing)
announcement - icon

Distributed systems often come with complex challenges such as service-to-service communication, state management, asynchronous messaging, security, and more.

Dapr (Distributed Application Runtime) provides a set of APIs and building blocks to address these challenges, abstracting away infrastructure so we can focus on business logic.

In this tutorial, we'll focus on Dapr's pub/sub API for message brokering. Using its Spring Boot integration, we'll simplify the creation of a loosely coupled, portable, and easily testable pub/sub messaging system:

>> Flexible Pub/Sub Messaging With Spring Boot and Dapr

eBook – Maven – NPI (cat=Maven)
announcement - icon

Get up to speed with the core of Maven quickly, and then go beyond the foundations into the more powerful functionality of the build tool, such as profiles, scopes, multi-module projects and quite a bit more:

>> Download the core Maven eBook

1. Overview

Simply put, Maven is a command-line tool for building and managing any Java-based project.

The Maven Project provides a simple ZIP file containing a precompiled version of Maven for our convenience. There is no installer. It’s up to us to set up our prerequisites and environment to run Maven.

Further reading:

Apache Maven Tutorial

A quick and practical guide to building and managing Java projects using Apache Maven.

Maven Dependency Scopes

A quick and practical guide to dependency scopes in Maven.

How to Create an Executable JAR with Maven

A quick and practical guide to creating executable JARs with Maven

The installation of Apache Maven is a simple process of extracting the archive followed by configuring Maven such that the mvn executable is available in the OS classpath.

1.1. Prerequisites

Maven is written in Java. So, to run Maven, we need a system that has Java installed and configured properly. We can download an OS-compatible Java JDK from Oracle’s download site, for example.  It’s recommended to install it to a pathname without spaces.

Once Java is installed, we need to ensure that the commands from the Java JDK are in our PATH environment variable.

To do so, we will run the command below to get the currently installed version info:

java -version

2. Installing Maven on Windows

To install Maven on Windows, we head over to the Apache Maven site to download the latest version and select the Maven zip file, for example, apache-maven-3.8.4-bin.zip.

Then, we unzip it to the folder where we want Maven to live.

2.1. Adding Maven to the Environment Path

We add both M2_HOME and MAVEN_HOME variables to the Windows environment using system properties and point them to our Maven folder.

Then, we update the PATH variable by appending the Maven bin folder — %M2_HOME%\bin — so that we can run the Maven command everywhere.

To verify it, we run:

mvn -version

The command above should display the Maven version, the Java version, and the operating system information. That’s it. We’ve set up Maven on our Windows system.

3. Installing Maven on Linux

To install Maven on the Linux operating system, we download the latest version from the Apache Maven site and select the Maven binary tar.gz file, for example, apache-maven-3.8.4-bin.tar.gz.

Redhat, Ubuntu, and many other Linux distribution are using the BASH as their default shell. In the below section, we will be using bash commands.

First, let’s create a location for Maven:

$ mkdir -p /usr/local/apache-maven/apache-maven-3.8.4

Then, we extract the archive to our Maven location:

$ tar -xvf apache-maven-3.8.4-bin.tar.gz -C /usr/local/apache-maven/apache-maven-3.8.4

3.1. Adding Maven to the Environment Path

We open the command terminal and edit the .bashrc file using the below command:

$ nano ~/.bashrc

Next, let’s add Maven-specific lines to the file:

export M2_HOME=/usr/local/apache-maven/apache-maven-3.8.4 
export M2=$M2_HOME/bin 
export MAVEN_OPTS=-Xms256m -Xmx512m 
export PATH=$M2:$PATH

Once we save the file, we can reload the environment configuration without restarting:

$ source ~/.bashrc

Finally, we can verify if Maven has been added:

$ mvn -version

The output should be similar to the below:

Apache Maven 3.8.4 (81a9f75f19aa7275152c262bcea1a77223b93445; 2021-01-07T15:30:30+01:29)
Maven home: /usr/local/apache-maven/apache-maven-3.8.4

Java version: 1.8.0_75, vendor: Oracle Corporation

Java home: /usr/local/java-current/jdk1.8.0_75/jre

We have successfully installed Maven on our Linux system.

3.2. Installing Maven on Ubuntu

In a terminal, we run apt-cache search maven to get all the available Maven packages:

$ apt-cache search maven
....
libxmlbeans-maven-plugin-java-doc - Documentation for Maven XMLBeans Plugin
maven - Java software project management and comprehension tool
maven-debian-helper - Helper tools for building Debian packages with Maven
maven2 - Java software project management and comprehension tool

The Maven package always comes with the latest Apache Maven.

We run the command sudo apt-get install maven to install the latest Maven:

$ sudo apt-get install maven

This will take a few minutes to download. Once downloaded, we can run the mvn -version to verify our installation.

4. Installing Maven on Mac OS X

To install Maven on Mac OS X operating system, we download the latest version from the Apache Maven site and select the Maven binary tar.gz file, for example, apache-maven-3.8.4-bin.tar.gz.

Then we extract the archive to our desired location.

4.1. Adding Maven to the Environment Path

First, let’s open the terminal and switch to the directory where the files were extracted to and then log in as superuser.

Second, we need to remove the tar.gz archive:

rm Downloads/apache-maven*bin.tar.gz

Third, we have to fix the permissions and switch the Maven contents:

chown -R root:wheel Downloads/apache-maven* 
mv Downloads/apache-maven* /opt/apache-maven

Then, let’s archive the Admin session and add Maven binaries to the path and append:

exit 
nano $HOME/.profile 
export PATH=$PATH:/opt/apache-maven/bin

Finally, we use Ctrl+x to save and exit from nano.

To load the new setup, let’s run:

bash

Now, we test if Maven is installed successfully using the command below:

mvn -version

We are now ready to use Maven on our Mac OS X.

4.2. Adding Maven to the Environment Path for macOS Catalina or Higher

macOS is abandoning the Bourne-Again Shell (bash), the command interpreter for most GNU / Linux distributions, in favor of the Z shell (zsh). This shell can be thought of as an extended version of bash.

Zsh sets itself apart with its advanced command completion mechanism, typo correction, and even feature-adding module system.

In the case of macOS Catalina or a higher version where the default shell is zsh, we have to append to a different file instead:

nano ~/.zshenv  
export PATH=$PATH:/opt/apache-maven/bin

To reload the environment, we need to issue:

source ~/.zshenv 

The rest of the operations remain the same.

4.3. HighSierra Compatibility

For HighSierra, we’ll need to additionally add Maven binaries to the path and append:

nano $HOME/.bashrc
export PATH=$PATH:/opt/apache-maven/bin

We use Ctrl+x to save and exit from nano. Then we run bash to load the new setup.

5. Conclusion

In this article, we learned how to install Maven for development on the major operating systems.

To learn how to get started with Spring and Maven, check out the tutorial here.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

eBook – HTTP Client – NPI EA (cat=HTTP Client-Side)
announcement - icon

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

eBook Jackson – NPI EA – 3 (cat = Jackson)