Maven

Maven Tutorials

Maven is a build tool based on POM and is generally used for Java projects to automatically download the project dependencies in build time.

Running JUnit Tests with Maven

Learn to run JUnit tests using Maven Surefire Plugin. We will learn to run a single test, run only selected tests or run all the tests in the project.

Maven – Remove All Corrupt Jars

Learn to rebuild local repository by deleting all corrupt jars from repository and fix missing maven dependencies problem or force update a maven project.

Spring Boot Multi-Module Maven Project

Learn to create a spring boot project having multiple modules. The parent project will work as a container for base maven configurations. The child modules will be actual spring boot projects – inheriting the maven properties from the parent project. 1. Parent Spring Boot Project The parent project is single …

Maven Multi-Module Project using Eclipse

Learn how to create a multi-module maven project in eclipse IDE. In this maven tutorial, we will learn to create nested maven projects in Eclipse. 1. Multi-module Project Structure Let’s create a maven project having modules packaging ear, war and jar types. We are creating the structure of an enterprise …

Spring Boot war Packaging Example

In Spring boot applications, the default packaging is jar which is deployed in embedded servers. Learn to generate a war file for deployment.

Tomcat Maven Plugin Example

In this maven tutorial, learn to add and configure tomcat plugin to pom.xml and use it deploy the web application without any tomcat installation in machine.

Maven Parent and Child POM Example

Maven parent POM (or super POM) is used to structure the project to avoid redundancies or duplicate configurations using inheritance between pom files.

Maven Dependency Management

In this Maven tutorial,  learn about Maven dependency management, including external dependency, transitive dependency tree, excluding dependencies and version ranges. 1. What is Maven Dependency? In Maven, a dependency is just another archive—JAR, ZIP, and so on—which our current project needs in order to compile, build, test, and/or run. These project dependencies are collectively specified in …

Maven – POM File

POM (Project Object Model) is an XML file that contains information about the project and configuration details used by Maven to build the project i.e. sourcecode location, project dependencies etc. This file must be named as pom.xml and placed under root folder of project.

Maven – Settings File

Maven settings.xml file contains configurations that are not specific to a project, but are global in nature. It also contains information that is not meant to be distributed (e.g. passwords).

JUnit 5 Maven Dependency

Learn to configure junit 5 with maven, its jupiter and platform different modules and how to use them to create and execute tests.

Maven: Create Java Source Folders in Eclipse

This is a very strange problem but this is the fact that when you create a maven web application using “-DarchetypeArtifactId=maven-archetype-webapp” then Java source folders are not created. Rather a ‘/resources‘ folder is created. Files placed in ‘/resources‘ folder are placed in your classpath when a jar or war file …

Maven BOM: Bill Of Materials Dependency

To solve the version mismatch issue, you can use the concept of a “bill of materials” (BOM) dependency. A BOM dependency keeps track of version numbers and ensures that all dependencies (both direct and transitive) are at the same version. 1. Why do we need the BOM file? If you …

Create Windows Executable (.exe) for Java Application

Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executable files. In this post, we will learn making such an executable file for a demo java application. Step1 ) Create a java application I am creating a very basic java class which simply …

Maven Enforce Minimum Java Version

Many times, we need to enforce that java build process should halt immediately if deployment environment does not have not a specific operating system, or it does not contain a minimum required java version. If you are using maven for build process, then these limitations can be easily be configured …

Maven ant plugin – Generate build.xml from pom.xml

Suppose you had created and maintained your project from maven for long time, but now you have instructions to move it to ant build environment. Well, it does not look easy, but it really is very much. All you need to use if maven ant plugin which is specifically only …

Maven – Local Repository Location

Learn where is maven local repository location? Learn how to change maven local repository location. Change repo location in windows 7, windows 10 & linux.

Create Maven Web Application and Import into Eclipse

Learn to create a Maven web project in Eclipse, which we should be able to import into the Eclipse IDE for further development. To create an Eclipse-supported web project, we will need to create a normal Maven web application and then make it compatible with the Eclipse IDE. Step 1: …

Maven – Create Java Project with Non/Interactive Mode

Learn to create a Java application project with maven, using interactive and non-interactive modes from the command prompt. 1. Using Maven Non-interactive Mode In non-interactive mode, Maven creates a blank Java project with all default options applicable for the selected Maven template. To create this, type the below command. This …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.