Setting Java Version used by Maven Compiler
Learn to configure the Java compiler version in a Maven project and a Spring boot application using Maven as a build tool.
Learn to configure the Java compiler version in a Maven project and a Spring boot application using Maven as a build tool.
Learn to fix Maven invalid target release error which indicates that Java versions used in Maven and in the application are not compatible.
Maven is a build tool based on POM and is generally used for Java projects to automatically download the project dependencies in build time.
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 keeps using a corrupt JAR or a cached failed download until we remove it. Learn which error means which problem, when mvn -U helps, and how to clean the local repository on any OS.
Build a Spring Boot 4 multi-module Maven project with a reusable library JAR and executable API. Run the reactor build, focused tests, and HTTP example.
Learn how to create multi-module maven project from console IDE. In this maven tutorial, we will learn to create nested maven projects maven cli commands.
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 …
In Spring boot applications, the default packaging is jar which is deployed in embedded servers. Learn to generate a war file for deployment.
Learn what Spring Boot’s Maven starter parent provides, how its BOM manages versions, and how Gradle or an existing Maven parent changes the setup.
Learn to create maven custom archetypes which helps in creating a specific type of project structure which is not available in any standard maven archetype.
A Maven parent POM is a pom.xml with packaging pom that child POMs inherit from. Learn what a child inherits, how relativePath finds the parent, dependencyManagement vs dependencies, and how modules differ from inheritance, with a two-module example.
Maven dependency scope is used to specify the visibility of a dependency. It provides six scopes i.e. compile, provided, runtime, test, system, and import.
Maven repositories are physical directories that contain packaged JAR files along with extra metadata. Learn about local, remote and central repositories.
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 …
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.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).
You may get this error when you have incompatible version of maven and it’s maven shade plugin. Fixing version number mismatch will solve the issue.
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 …
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 …
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 …
Learn to create a new Maven project in IntelliJ, run commonly used Maven commands and fix Maven issues in IntelliJ with examples.
The Maven Enforcer Plugin stops a build with a clear message when the JDK, the Maven version or the operating system does not match. Learn requireJavaVersion, requireMavenVersion, requireOS, version ranges, custom messages and skips.
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 …
Learn how to change the Maven local repository location in Eclipse by updating M2_REPO variable and, temporarily, only for current Maven execution.
Maven proxy settings. Learn to configure maven proxy settings in settings.xml file. Learn to configure and use maven https proxy settings in eclipse.
Learn where is maven local repository location? Learn how to change maven local repository location. Change repo location in windows 7, windows 10 & linux.
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: …
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 …
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.