Questions tagged [maven-3]

Apache Maven is a tool for project management and build automation. This tag is for questions relating to Maven version 3.x. For non version-specific questions, please use the [maven] tag.

Apache Maven is a tool for project management and build automation. Maven relies on a pom.xml file that describes the project instead of defining a set of tasks, like Ant does.

A basic pom.xml looks like:

<project>
  <!-- model version is always 4.0.0 for Maven 2 and Maven 3 POMs -->
  <modelVersion>4.0.0</modelVersion>

  <!-- A project is identified by its groupId, artifactId and version -->
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0</version>

  <!-- Dependencies -->
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <!--
           The scope allows you to limit the usage of this dependency.
           In this case, this library will only be used for tests purposes.
      -->
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Many plugins exist, and offer more functionalities to the tool.


For non version-specific questions, please use , for the older maven versions 2.x or the legacy 1.x use or , 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.

5199 questions
53
votes
6 answers

How to execute mvn command using IntelliJ IDEA?

I am trying to add Oracle JDBC driver in my local Maven repo. I have found this link to do so. I want to do the same from Inside IntelliJ IDEA. Is there any way to execute mvn commands from IntelliJ IDEA?
vatsal mevada
  • 5,148
  • 7
  • 39
  • 68
52
votes
1 answer

Maven managed dependencies - resolving ${project.version} from parent pom

How is placeholder ${project.version} resolved for managed properties from parent pom? I've expected that it is resolved globally, so when the parent pom has version 2, ${project.version} would also be resolved to version 2. In parent pom I…
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
52
votes
7 answers

Maven error: Not authorized, ReasonPhrase:Unauthorized

I checked out my code from the Nexus repository repository. I changed the password for my account and set it correctly inside my settings.xml file. While executing mvn install clean I get the error saying Not authorized, ReasonPhrase:Unauthorized…
Mahendra Liya
  • 12,912
  • 14
  • 88
  • 114
51
votes
4 answers

Where is super pom for maven 3?

For maven 2 it used to be in M2_HOME/lib/maven-2.2.1-uber.jar:org/apache/maven/project/pom-4.0.0.xml But 3.0.x does not have a single jar.
Alexander Pogrebnyak
  • 44,836
  • 10
  • 105
  • 121
50
votes
2 answers

How to exclude maven dependencies?

I have a question about exclusion of maven dependencies. Consider the following org.springframework.security spring-security-taglibs
Aravind A
  • 9,507
  • 4
  • 36
  • 45
50
votes
4 answers

Maven 3 - Worth it?

Maven 3 beta is out since a couple of weeks and I just want to get your views on the feature list for Maven 3. Because to me, only two major features were added Parallel execution of of project in the build lifecycle Custom lifecycle Everything…
Manoj
  • 1,384
  • 4
  • 14
  • 19
50
votes
3 answers

How do you stop maven from trying to access http://repo.maven.apache.org?

The development machine cannot access the internet, and take about 60s to timeout. When I try to build, I see Downloading: http://repo.maven.apache.org/maven2/com/google/gsa-connector/2.8.0/gsa-connector-2.8.0.pom However, I have the following in…
Chloe
  • 25,162
  • 40
  • 190
  • 357
49
votes
3 answers

How can I write maven build to add resources to classpath?

I am building a jar using maven with simple maven install. If I add a file to src/main/resources it can be found on the classpath but it has a config folder where I want that file to go but moving it inside the config folder makes it disappear from…
Java Ka Baby
  • 4,880
  • 11
  • 39
  • 51
49
votes
5 answers

IncompatibleClassChangeError: class ClassMetadataReadingVisitor has interface ClassVisitor as super class

I have built a web application using spring-mvc and mongodb as database. I used maven3 to build the application. Project builds successfully but when application starts I am getting the following error in the logs due to which my application does…
Sharad Yadav
  • 2,951
  • 5
  • 20
  • 18
47
votes
4 answers

Using Maven to just download JARs

I would like to have Maven download the JARs listed in a pom.xml file. How do I do that? Currently, Maven wants to compile the project (and it fails). I don't care about compiling it because I'm compiling manually. I just want the JARS. …
Albert
  • 523
  • 2
  • 5
  • 5
47
votes
1 answer

How to make war file in Eclipse

What is the easy way to make war file? My project is working when i right click run on server, but i want to deploy on tomcat server. I have installed m2clipse but it gave me an error. Is maven compulsory to make war file? Do i need special…
John
47
votes
5 answers

What is the difference between artifactId and groupId in pom.xml?

How would you explain it to a newbie web developer or programmer with some real world organization example (like say facebook company or Google company)?
sofs1
  • 3,834
  • 11
  • 51
  • 89
47
votes
6 answers

How to eliminate the "maven-enforcer-plugin (goal "enforce") is ignored by m2e" warning by eclipse?

I am configuring a multi-module parent child maven project using maven and eclipse m2e, I am using the latest stuff from eclipse Juno SR1 which is m2e 1.2.0 the parent pom uses the enforcer plugin, so the parent pom.xml has the following in its…
ams
  • 60,316
  • 68
  • 200
  • 288
46
votes
4 answers

How to create a project using maven-archetype-plugin? What is artefactId etc?

I am new to Maven and am using the maven.apache.org tutorial here as an introduction. In the "How do I make my first Maven project?" section of the tutorial, it teaches us to generate a Maven archetype project by executing the following command: mvn…
Mellon
  • 37,586
  • 78
  • 186
  • 264
46
votes
11 answers

Unable to import maven project in IntelliJ14

I'm trying to import the Maven projects from IntelliJ button (the one with the arrows in circle), but I get the following message "Unable to import maven project. See logs for details", as shown in the following picture If I go into the log, I…
JeanValjean
  • 17,172
  • 23
  • 113
  • 157