Questions tagged [maven]

Apache Maven is a build automation and project management tool used primarily for Java projects. This tag is for questions that don't relate to a specific Maven version. Use the gradle tag instead for questions relating to Gradle.

Apache Maven is a build automation tool used primarily for Java projects. Based on the concept of a Project Object Model (POM), Maven can manage a project's build, reporting, and documentation from a central piece of information.

Maven's objectives

Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. Maven adheres to the principle of "convention over configuration" that helps building Maven projects with very little configuration. Systems, libraries, and frameworks should assume reasonable defaults, and systems should "just work" without requiring unnecessary configuration. In order to attain this goal, there are several areas of concern that Maven attempts to deal with:

  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features

The configuration of a Maven project is done by creating a file called pom.xml located at the root of the project. This file is referred to as the POM file. Each POM file inherits from a global Super POM that defined common properties for all Maven projects.

If you see questions with this tag that specifically refer to the Maven versions 2.x, 3.x (or the legacy 1.x), please re-tag them with , and , respectively.

If you see questions related to a specific Maven plugin, please also check whether the related plugin tag is present (i.e. , ).

Questions related to Maven plugin development should also have the , while questions related to Maven profiles should also have the tag, and questions related to Maven archetypes should also have the tag.

More information

Free Maven Books

Frequently Asked Questions:

People often ask about the following topics:

General:

Maven Repository:

87627 questions
367
votes
7 answers

What is an uber JAR file?

I am reading Maven documentation and came across the name uber-jar. What does an uber-jar mean and what are its features/advantages?
Ashay Batwal
  • 5,415
  • 7
  • 25
  • 30
356
votes
37 answers

org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

I am trying run a spring-boot application which uses hibernate via spring-jpa, but i am getting this error: Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set at…
Kleber Mota
  • 8,521
  • 31
  • 94
  • 188
351
votes
8 answers

Is there a simple way to remove unused dependencies from a maven pom.xml?

I have a large Maven project with many modules and many pom.xml files. The project has changed and I suspect the pom's contain some unnecessary dependencies. Is there is a command which removes any unused dependencies from a pom?
thickosticko
350
votes
31 answers

Cannot change version of project facet Dynamic Web Module to 3.0?

I am using maven to create a dynamic webapp in Eclipse. I added some folders like src/test/java and src/test/resources. Also I changed the library in Java Build Path to obtain the JavaSE-1.7. It's all OK up to here. When I tried to change the…
EdgarZeng
  • 3,678
  • 4
  • 15
  • 10
349
votes
13 answers

Maven in Eclipse: step by step installation

I have spent been on the Maven site reading the 5- and 30-minute tutorials, and trialing Maven out for the first time. I want to install a Maven plugin and use it to start building Maven projects from Eclipse. Despite an honest effort, I have been…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
349
votes
22 answers

"webxml attribute is required" error in Maven

I am getting the following error: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) I have got web.xml in right place which is projectname\src\main\webapp\WEB-INF\web.xml What could…
user617966
  • 4,515
  • 4
  • 23
  • 24
345
votes
19 answers

Maven is not working in Java 8 when Javadoc tags are incomplete

Since I use Maven I have been able to build and install in my local repository projects that have incomplete Javadoc tags (for example, a missing parameter). However, since I migrated to Java 8 (1.8.0-ea-b90) Maven is absolutely strict about…
Sergio
  • 8,532
  • 11
  • 52
  • 94
337
votes
9 answers

Hosting a Maven repository on github

I have a fork of a small open sourced library that I'm working on github. I'd like to make it available to other developers via maven, but I don't want to run my own Nexus server, and because it's a fork I can't easily deploy it to…
emmby
  • 99,783
  • 65
  • 191
  • 249
335
votes
25 answers

Maven error "Failure to transfer..."

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse: Description Resource Path Location Type Could not calculate build plan: Failure to transfer…
Deepak Joy Cheenath
  • 5,796
  • 5
  • 25
  • 29
331
votes
25 answers

Maven: Failed to read artifact descriptor

I am hoping someone can help me with a problem I am struggling with. When I try to build my project from the terminal I get this error: Failed to read artifact descriptor for com.morrislgn.merchandising.common:test-data-utils:jar:0.3b-SNAPSHOT:…
Morrislgn
  • 3,717
  • 4
  • 24
  • 26
330
votes
16 answers

Retrieve version from maven pom.xml in code

What is the simplest way to retrieve version number from maven's pom.xml in code, i.e., programatically?
Michael
  • 4,635
  • 7
  • 25
  • 33
329
votes
1 answer

Multiple maven repositories in one gradle file

So my problem is how to add multiple maven repositories to one gradle file. This DOESN’T work: repositories { mavenCentral() maven { url "http://maven.springframework.org/release" url "http://maven.restlet.org" } }
AZ_
  • 21,688
  • 25
  • 143
  • 191
325
votes
6 answers

Difference between maven scope compile and provided for JAR packaging

What is the difference between the maven scope compile and provided when artifact is built as a JAR? If it was WAR, I'd understand - the artifact would be included or not in WEB-INF/lib. But in case of a JAR it doesn't matter - dependencies aren't…
emstol
  • 5,966
  • 6
  • 27
  • 32
325
votes
5 answers

How to run Maven from another directory (without cd to project dir)?

Supposing my maven project is located in /some/location/project and my current location is /another/location/ how can I run maven build without changing to project location cd /some/location/project?
Ali Shakiba
  • 20,549
  • 18
  • 61
  • 88
325
votes
52 answers

Maven plugins can not be found in IntelliJ

After updating IntelliJ from version 12 to 13, the following Maven-related plugins cannot be…
Spring
  • 11,333
  • 29
  • 116
  • 185