Category Archives: maven

How to exclude dependency in maven?

In this post, We will learn How to exclude dependency or specific version dependency in maven? Whenever we have transitive dependencies in our project, there we may get version mismatch issues between the dependencies of the artifacts or mismatch in versions of our project artifact and the deployment platform’s artifact. That can be done by excluding dependencies… Read More »

How to Fix missing src/main/java & src/test/java folders in the Eclipse Maven web Project?

In this post, We will learn How to Fix missing src/main/java & src/test/java folders in the Eclipse Maven web Project? How to fixing src/main/java and src/test/java folders in Eclipse Maven Project – 2 build path entries are missing: Sometimes, when you create a maven web application project, you will not see src/main/java and src/test/java as a source folder. When you try to… Read More »

Compiling the Maven project with different JDK versions? 

In this post, We will learn about Compiling the Maven project with different JDK versions?  Usually, by default, maven 2 supports JDK 1.4, and maven 3 uses JDK 1.5 to compile the project. Which is really too old.  Maven comes with a Compiler Plugin, This compiler plugin helps maven to compile the project source code with a… Read More »

How to create a runnable JAR file with Maven?

In this post, We will learn How to create a runnable JAR file with Maven?  Sometimes when We create a jar file, we want to execute it easily without using any IDE. To create an executable jar File, we don’t need any additional dependencies. You just need to create a Maven project and have at minimum one class with… Read More »

How to enable a proxy setting in Maven?

In this post, We will learn How to enable a proxy setting in Maven? Steps to Enable  a proxy setting in Maven: First of all, You have to locate your maven settings.xml file from Eclipse -> Preferences -> Maven -> User Settings  Default locations: For Linux: /home/{username}/.m2/ For Windows: C:\Users\{username}\.m2\ 2. Add the following XML code to the settings.xml file… Read More »

Importing maven remote Archetype Catalogs in eclipse ?

This tutorial will give you easy explanations to import maven remote archetype catalogs in eclipse to give you a head start in configuring the project.  Step 1: Open the maven preferences in eclipse Navigate to Windows -> Preferences -> Maven -> Archetypes. Step 2: Add or remote catalog file Click on the Add Remote Catalog button. Type the catalog file as “http://repo1.maven.org/maven2/archetype-catalog.xml” and provide… Read More »

How to add or update the maven settings.xml file in eclipse?

In this post, We will learn about How to add or update the maven settings.xml file in eclipse? We may use the global setting usually and do not touch the second option user setting. For that, You will have to store your setting.xml in the Global Setting location. If We want the setting.xml file at the… Read More »

What is maven local repository location & how to change it?

In this post, We will learn about What is maven local repository location & how to change it? Maven downloads the required artifacts or dependencies (jar files) and other plugins which are configured as part of any project, there must be a commonplace where all such artifacts are placed. This common shared area is called… Read More »

How to create user defined properties in Maven ?

In this post, We will learn How to create user-defined properties in Maven? There are scenarios when we want to create variables or properties and afterward reuse it in pom.xml so that it can be managed easily. The properties can be defined as below:

For example – look at the below example, Where spring.version has… Read More »

How to add local jar files to a Maven project?

This post talks about adding local jar files to a Maven project?  For those artifacts or libraries that are not available in the Maven Central or other Maven repositories, we have to configure it into our Maven Local repository in order to use it as a project dependency. We can add local dependencies directly like this:… Read More »