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
23
votes
3 answers

how to increase ant permgen size?

how to increase ant permgen size? I have given in ANT_OPTS as -Xms768m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m question 1)After specifying above setting in system environment, still i am getting outof memeory error for ant target for…
TechFind
  • 3,696
  • 18
  • 47
  • 62
23
votes
2 answers

What's wrong with my Apache CXF client?

This is part of my pom.xml: org.apache.cxf cxf-rt-frontend-jaxws ${cxf.version} runtime
yegor256
  • 102,010
  • 123
  • 446
  • 597
23
votes
1 answer

How to access maven dependecy from GitHub Package Registry (Beta)

I uploaded a maven artefact to the GitHub Package Registry (Beta) and want to add it as maven dependency. I'm already in the Regestry-Beta and activated it for my sample HalloMaven project. Also the mvn deploy was succesful, so the artifact is…
Tobse
  • 1,176
  • 1
  • 9
  • 22
23
votes
4 answers

PMD/CPD: Ignore bits of code using comments

Is there a way to tell PMD to ignore checking parts of code for duplication? For example, can I do something like this: // CPD-Ignore-On ... // CPD-Ignore-Off Currently I have PMD set up like this using Maven, but don't see any arguments that would…
digiarnie
  • 22,305
  • 31
  • 78
  • 126
23
votes
7 answers

maven in 5 min not working

I have downloaded latest maven 3.0.3, java version "1.6.0_18". mvn –version Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home: C:\software\apache-maven-3.0.3 Java version: 1.5.0_05, vendor: Sun Microsystems Inc. Java…
AKB
  • 5,918
  • 10
  • 53
  • 90
23
votes
1 answer

What does the Maven verify command do?

It says in the documentation that the verify phase in the build lifecycle run any checks on results of integration tests to ensure quality criteria are met What does this exactly mean?
kaka
  • 597
  • 3
  • 5
  • 16
23
votes
12 answers

How to set environment variable in React JS..?

I am new to React JS. I am trying to build war file from React App but stuck somewhere below. It gives me below errors. Creating an optimized production build... Treating warnings as errors because process.env.CI = true. Most CI servers set it…
Developer Desk
  • 2,294
  • 8
  • 36
  • 77
23
votes
2 answers

How to add WAR inside EAR with Maven

I have EAR with an application and I need to extend this app with my own code that is packaged as a WAR. Is there a maven plugin that can help me with putting the WAR inside the EAR? The manual procedure is to put WAR inside EAR and add module to…
stalker
  • 1,300
  • 1
  • 13
  • 16
23
votes
12 answers

Maven in Eclipse complains that "Unable to locate the Javac Compiler" whenever POM changed

I got error message every time I changed my pom.xml in eclipse. Build errors for myapp; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on…
Tom
  • 2,857
  • 9
  • 46
  • 59
23
votes
1 answer

Empty goals list in m2Eclipse

When I try to add a goal I don't get any goals. Is there any solution or I should manually add them.But in an example I saw it automatically lists all the available goals.
Praneel PIDIKITI
  • 18,677
  • 13
  • 41
  • 60
23
votes
3 answers

Append the value of argLine param in maven-surefire-plugin

I am using maven-surefire-plugin + Sonar together and I would like to add some extra value to argLine parameter of the maven-surefire-plugin. So I did it:
zappee
  • 20,148
  • 14
  • 73
  • 129
23
votes
4 answers

How to express dependency in maven on java ee features for transition to Java 9?

We use maven and have artifacts that in turn depend on other internal artifacts. I am in the process of migrating to java-9, and intend to migrate everything to Java 9 first without modularizing the code (i.e. in the unnamed module). The problem I…
Kevin Peterson
  • 7,189
  • 5
  • 36
  • 43
23
votes
7 answers

Import Maven multi-module project into Eclipse

How do I properly import a Maven multi-module project into Eclipse? When I import a new Maven project and select the parent pom, I can see the submodules under the parent pom which are visible in the package explorer and project explorer. However,…
Tuomas Toivonen
  • 21,690
  • 47
  • 129
  • 225
23
votes
3 answers

How do I get Sonarcloud to run on pull requests from forks with Travis, Maven & github

While looking into my recent question Sonarcloud failure with Travis, Maven & github I realised that I was asking the wrong question. I was trying to address a symptom rather than the underlying problem. A project I work on (eclipse/scanning) uses…
Mark Booth
  • 7,605
  • 2
  • 68
  • 92
23
votes
6 answers

ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context

I am developing a spring boot application and using HikariCP connection pool and JDBC Template to insert data into Database.But when I start I get the error. java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call…
Ricky
  • 2,662
  • 5
  • 25
  • 57
1 2 3
99
100