Create Executable Jar with Dependencies using Maven

1. Introduction Every Maven project includes a packaging property that specifies the artifact type like jar, war, and others. The default packaging...

Continue Reading

Add Multiple Resource Directories using Maven

1. Overview With the default Maven layout, we store resource files under the src/main/resources directory. After a build, Maven moves these files t...

Continue Reading

Add Multiple Source Directories using Maven

1. Overview By default, Maven uses the /project-path/src/main/java directory as the only source directory. However, in some cases, we need to defin...

Continue Reading

Maven Surefire Plugin

1. Introduction In this tutorial, we'll examine the Maven Surefire Plugin. It is the plugin that runs the unit tests in a Maven project. 2. The Goa...

Continue Reading

Set Java Version on Maven

1. Overview In this tutorial, we're going to look at how we can set the Java version on a Maven project. To compile our source code, Maven uses the...

Continue Reading

Run a Single Test using Maven

1. Overview In this quick tutorial, we'll look at how we can run a single test using Maven. 2. Unit Tests We'll first look at the unit tests. 2.1. ...

Continue Reading

Guide to Selecting Tests with Maven

1. Overview In this tutorial, we're going to look at how we can select unit tests using Maven. For this purpose, we'll examine different configurat...

Continue Reading

Debug Tests using Maven

1. Overview In this tutorial, we're going to look at how we can debug our unit tests and integration tests using Maven. For this purpose, we'll exa...

Continue Reading

Set System Property for Tests using Maven

1. Overview In this tutorial, we'll look at how we can set a Java system property for the tests run by Maven. By doing this, we can ignore tests ac...

Continue Reading