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
137
votes
24 answers

Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not found

I'm facing an error in my pom.xml file given below: Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not found Below is my pom.xml :
Lakma Chehani
  • 1,415
  • 2
  • 6
  • 5
137
votes
6 answers

Add Maven repository to build.gradle

I added a custom maven repository to build.gradle in Android Studio but the dependency is not being found Maven repository and dependency achartengine Public AChartEngine repository
André Ricardo
  • 3,051
  • 7
  • 23
  • 32
137
votes
1 answer

Maven : what is the "runtime" scope purpose?

Possible Duplicate: Understanding Compile- vs Run-time Dependencies I understand that a dependency with the "runtime" scope will be available at runtime and not at compile time. But I don't understand why you could want that! Why not simply use…
electrotype
  • 8,342
  • 11
  • 59
  • 96
136
votes
16 answers

javax.validation.ValidationException: HV000183: Unable to load 'javax.el.ExpressionFactory'

I try to write very simple application with hibernate validator: my steps: Added following dependency in pom.xml: org.hibernate hibernate-validator
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
135
votes
2 answers

Install parent POM without building Child modules

I have a parent POM in a Maven project, with this structure: parent | --------------- | | child1 child2 I want to install the POM of the "parent" in the local REPO to allow child1…
Mr.Eddart
  • 10,050
  • 13
  • 49
  • 77
135
votes
9 answers

Why maven? What are the benefits?

What are the main benefits of using maven compared to let's say ant ? It seems to be more of a annoyance than a helpful tool. I use maven 2, with plain Eclipse Java EE (no m2eclipse), and tomcat. Supporters of maven believe that Maven lets you get…
trix
  • 1,837
  • 3
  • 17
  • 17
135
votes
6 answers

Difference of Maven JAXB plugins

I have determined that two JAXB plugins for Maven 2 exist, with some different configurations. The one is from Sun: http://jaxb.dev.java.net/jaxb-maven2-plugin/, the other from Mojohaus: http://mojohaus.org/jaxb2-maven-plugin/ Which of these two…
cuh
  • 3,723
  • 4
  • 30
  • 47
135
votes
1 answer

Eclipse : An error occurred while filtering resources

I am building a Spring MVC project, and Eclipse is throwing this error (see screenshot). My pom.xml is:
Amarsh
  • 11,214
  • 18
  • 53
  • 78
134
votes
8 answers

maven-site plugins 3.3 java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent

Since this night, maven site 3.3 plugins stop to work. Try to delete local repository, but no change. Maven 3.3.9 java 1.8 No config or dependencies defined in pom for site plugins [WARNING] Error injecting:…
timmy otool
  • 1,353
  • 2
  • 8
  • 4
133
votes
3 answers

How to specify maven's distributionManagement organisation wide?

I'm trying to figure out how to organize many (around 50+) maven2 projects, so that they can deploy into a central nexus repository. When using the mvn deploy goal, one does need to specify the target in the distributionManagement tag like…
mglauche
  • 3,344
  • 4
  • 28
  • 31
132
votes
5 answers

Disable maven checkstyle

I want to execute a maven target but checkstyle errors forbids that. I have no time right now to correct checkstyle error (my checkstyle rules have been recently updated and I can't handle all of them right now). Is there a way to disable…
RandomCoder
  • 6,606
  • 6
  • 22
  • 28
131
votes
15 answers

How do I configure Maven for offline development?

Does maven require a connection to the internet at some point to be able to use it? Meaning specifically getting the internal maven plugins for compiling, cleaning, packaging, etc?
user130532
131
votes
2 answers

What is the "reactor" in Maven?

I've been reading about Maven reactor and am confused by its terminology usage. I've read that a multi-module is a reactor, that you can manipulate the maven reactor and that the reactor is a plugin. What exactly is the reactor?
harschware
  • 13,006
  • 17
  • 55
  • 87
130
votes
3 answers

Make maven's surefire show stacktrace in console

I'd like to see the stacktrace of unit tests in the console. Does surefire support this?
IAdapter
  • 62,595
  • 73
  • 179
  • 242
129
votes
16 answers

Error when deploying an artifact in Nexus

Im' getting an error when deploying an artifact in my own repository in a Nexus server: "Failed to deploy artifacts: Could not transfer artifact" "Failed to transfer file http:///my_artifact. Return code is: 400" I have Nexus running with one custom…
acimutal
  • 2,155
  • 2
  • 17
  • 22