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.
Maven parent POM (or super POM) is used to structure the project to avoid redundancies or duplicate configurations using inheritance between pom files.
Maven scope attribute is used to specify the visibility of a dependency, relative to the different lifecycle phases (build, test, runtime etc). Maven provides six scopes i.e. compile, provided, runtime, test, system, and import.
Maven repositories are physical directories which contain packaged JAR files along with extra meta data about these jar files. This meta data is in form of POM files which have jar file project information, including what other external dependencies this JAR file has. These other external dependencies are downloaded transitively into your project and become […]
In Maven, dependency is another archive—JAR, ZIP, and so on—which your current project needs in order to compile, build, test, and/or to run. The dependencies are gathered in the pom.xml file, inside of a <dependencies> tag. When you run a build or execute a maven goal, these dependencies are resolved, and are then loaded from […]
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.
Learn to use Maven Shade plugin to package a java project along with it’s dependencies into a fat jar or uber jar.
This is very strange problem but this is fact that when you create a maven web application using “-DarchetypeArtifactId=maven-archetype-webapp” then no java source folder is created. Rather a resources folder is created. Files placed in resources folder are placed in your classpath when war file is created for your web application. To create java source […]
If you have worked on maven in your projects for dependency management, then you must have faced one problem at least once or may be more than that. And the problem is version mismatch. It generally happens when you got some dependencies which bring it’s related dependencies together with certain version. And if you have […]
I have been facing this issue from quite long time as I didn’t took care of it. Everytime I faced this issue, I just went and changed the project compiler level for projects facets menu in eclipse. Today, I decided to end this for all. This error looks like in eclipse is as follow: Reason: […]
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 displays a frame and some […]
We have learned that how to create a simple java project in maven and also how to convert it to support eclipse IDE.Sometimes developers environment consist of IntelliJ IDE instead of eclipse. So, lets learn about converting it to support IntelliJ also. Using an example to demonstrate is always a good way. So, lets see […]
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 using maven enforcer plugin. The […]
Suppose you had created and maintained your project from maven from 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’s ant plugin which is specifically only for this purpose. Lets see […]
We know that what is use maven and how to use it from command prompt. Maven dependencies can be read from eclipse IDE also which maven exposes through M2_REPO classpath variable which points to maven’s local repository. This class variable must be added to eclipse ‘s class path variable on build path before using maven’s […]
By default, maven uses default network connection running on your local system. But, sometimes you are running your application in your workplace or company. These networks shields their intranet through proxy servers, so all internet queries made from your system goes through this proxy server. Maven by default does not respect them, and to use […]
Maven is build and dependency management tool as we all know. It downloads required project dependencies to your local system and include them to your project compilation or run-time as defined. By default maven’s local repository exist on following path : C:/Documents and Settings<windows username>/.m2/repository You can change this location to some other location of […]
In my previous post, we learned about creating a sample java project using maven using both modes i.e. interactive and non-interactive. In this project we will create a web application which we should be able to import on eclipse IDE. To create eclipse supported web application, we will need to create first a normal maven […]