Introduction Here I will show you how to create maven project using CLI. CLI means command line interface, so you need to use command line tool (cmd prompt) in Windows or Shell terminal in Unix based system. You can use any IDE (for example, Eclipse) or tool to create a new maven project. During project creation…

Posted in Maven

How To Create Maven Project Using CLI

Introduction Here in this tutorial I will tell you how to exclude Junit test cases from build automation in Java applications. It’s not about skipping test cases but it’s about excluding test cases for a particular package. Situations may arise when you want to exclude some Junit test cases from running in some environments (for…

Posted in Gradle Junit Maven

How To Exclude Junit Tests Using Gradle Or Maven In Java Applications

Introduction In this tutorial I will tell you how to create executable jar using gradle or maven build tool in Spring Boot application. Generally maven or gradle tool is used in Java applications to automate the build process. I will also see how to control the target jar name with version appended into it. Spring…

Posted in Gradle Maven Spring Boot

How to create executable jar using Gradle or Maven in Spring Boot Application

Introduction Here I will discuss how to manage dependencies and plugins in multi module project using maven. A multi-module project is built from a parent pom that manages a group of sub-modules. In most of the cases, the parent pom is located in the parent project’s root directory and must have packaging of type pom. So…

Posted in Maven

Managing Dependencies and Plugins in Multi Module Project

Introduction Here you will see maven profile and non-profile based plugin execution. Situation may occur when you need to execute plugin(s) for different profile(s) and plugin(s) which do not need any profile for your application. For example, let’s say you want to copy some configuration files into some specific location for local environment where your…

Posted in Maven

Maven Profile And Non-profile Based Plugin Execution

Introduction In this post I will discuss about replacing the multiple tokens in XML file using maven-resources-plugin. Situation may occur where you need to replace some place holders in the XML file during build of your application and need to create a zip file under the target directory, then you may use this example as…

Posted in Maven

Maven Filtering Replace Multiple Tokens During Build

Introduction This post is about creating zip for dependencies using maven assembly plugin. Sometimes you may need to create a zip from your application with dependencies only, i.e., to include only the jar libraries which are being used for your application. Then this tutorial will help you to understand how to create such zip file…

Posted in Maven

Creating ZIP for Dependencies using Maven Assembly Plugin

Introduction Here you will see how to create zip file using maven build tool with the help of maven-assembly-plugin. Situation may occur while one of the multi-modules project may have a module with only some configuration files, such as, shell scripts, XMLs, properties or any other files that basically do not produce a meaningful jar…

Posted in Maven

Create Zip File Using Maven Assembly Plugin

Introduction In this post you will see how to prevent JAR creation using maven build tool if your application does not have the required Java classes or resource files. Actually you don’t need to create jar file when your project does not contain any Java or resource files. I will use maven-jar-plugin which is used…

Posted in Maven

Prevent JAR Creation using Maven

Introduction You will see in this post how to create multiple executable jars using maven build tool. You have seen how to create executable jar using maven build tool. I had created only single executable jar file in previous example but here I will create multiple jars.

Posted in Maven

Creating Multiple Executable Jars using Maven

Introduction Here you will see an example on how to remove default jar by maven build tool. Generally this may be required in a situation where you are generating executable jar or executable jars and your application does not require additional non-executable jar generated by maven build. Then you can remove such jar from the…

Posted in Maven

Removing Default Jar created by Maven Build

Introduction Here you will see the process of packaging WAR, JAR modules into EAR file. EAR, also known as, Enterprise Archive, in which all files (.jar and .war) are packaged as JAR file with .ear (enterprise archive) extension and deployed into Application Server.

Posted in Java Maven

Packaging WAR, JAR modules into EAR using Maven Build Tool