Questions tagged [maven-2]

Apache Maven is a software project management and comprehension tool. This is a tag for Maven related questions that are specific to Maven versions 2.x.

About Maven:

Apache Maven is a software project management and comprehension tool. 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.

For questions that are not version-specific, use , for Maven 3.x - specific questions, use

Please be aware of Maven 2 End Of Life

Maven Releases History, with documentation

5648 questions
185
votes
4 answers

Gradle alternate to mvn install

I have 2 different project build on mvn. I am trying to replace to Gradle. Project 1 is an SDK, and project 2 is using that sdk (example). In the time of maven it creates artifact using mvn install which adds the whole project into local…
Rajmahendra
  • 2,710
  • 2
  • 27
  • 39
183
votes
11 answers

How can I download a specific Maven artifact in one command line?

I can install an artifact by install:install-file, but how can I download an artifact? For example: mvn download:download-file -DgroupId=.. -DartifactId=.. -Dversion=LATEST
Xiè Jìléi
  • 12,317
  • 15
  • 72
  • 100
182
votes
9 answers

Differences between Ant and Maven

Could someone tell me the differences between Ant and Maven? I have never used either. I understand that they are used to automate the building of Java projects, but I do not know where to start from.
rtacconi
182
votes
11 answers

Get Maven artifact version at runtime

I have noticed that in a Maven artifact's JAR, the project.version attribute is included in two files: META-INF/maven/${groupId}/${artifactId}/pom.properties META-INF/maven/${groupId}/${artifactId}/pom.xml Is there a recommended way to read this…
Armand
  • 21,079
  • 16
  • 81
  • 113
181
votes
15 answers

Spring 3.0 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]

Any ideas what could be the cause of this? Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security] org.springframework.web.context.ContextLoader initWebApplicationContext: Context…
Taylor Leese
  • 46,410
  • 27
  • 106
  • 138
181
votes
9 answers

How do I get my Maven Integration tests to run

I have a maven2 multi-module project and in each of my child modules I have JUnit tests that are named Test.java and Integration.java for unit tests and integration tests respectively. When I execute: mvn test all of the JUnit tests *Test.java…
Peter Delaney
  • 4,998
  • 9
  • 31
  • 36
179
votes
18 answers

Get source jar files attached to Eclipse for Maven-managed dependencies

I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time saver. Unfortunately, it does not include API…
Thilo
  • 241,635
  • 91
  • 474
  • 626
177
votes
4 answers

Disable a Maven plugin defined in a parent POM

I am using a parent POM that defines a plugin that I do not want to be run in a child POM. How can I disable the plugin in the child pom completely? Constraint: I cannot change the parent POM itself.
tobiasbayer
  • 9,921
  • 4
  • 42
  • 64
177
votes
6 answers

Maven check for updated dependencies in repository

Is there a Maven plugin that allows you to check if there are newer versions of dependencies available in the repository? Say, you are using dependency X with version 1.2. Now a new version of X is released with version 1.3. I'd like to know, based…
froethen
  • 1,783
  • 2
  • 11
  • 5
171
votes
4 answers

Maven: how to do parallel builds?

When you build with maven on a multicore / multi-CPU machine it would often be possible to build different subprojects in parallel. Is there a way to do this with maven? Is there a plugin for this / whatever?
Hans-Peter Störr
  • 22,852
  • 27
  • 96
  • 134
159
votes
15 answers

Maven: best way of linking custom external JAR to my project?

It's my first couple of days learning Maven and I'm still struggling with the basics. I have an external .jar file (not available in the public repos) that I need to reference in my project and I'm trying to figure out what my best option is. It's…
Alexandr Kurilin
  • 7,188
  • 6
  • 43
  • 72
158
votes
14 answers

Specify JDK for Maven to use

I am trying to build a Hudson plugin I've modified and it requires jdk1.6. This is fine, but I don't see how I can tell maven where the different jdk is. I've found few mentions on the internet but they don't seem to apply to me. Some suggest adding…
DanInDC
  • 4,489
  • 8
  • 28
  • 25
154
votes
10 answers

How to change maven logging level to display only warning and errors?

I want to prevent maven from displaying INFO messages, I want to see only WARNINGS and ERRORS (if any). How can I achieve this, preferably by changing the command line that calls maven?
sorin
  • 137,198
  • 150
  • 472
  • 707
152
votes
13 answers

Force re-download of release dependency using Maven

I'm working on a project with dependency X. X, in turn, depends on Y. I used to explicitly include Y in my project's pom. However, it was not used and to make things cleaner, I instead added it to X's pom as a dependency. X is marked as a release…
volni
  • 4,636
  • 8
  • 35
  • 44
146
votes
12 answers

Warning - Build path specifies execution environment J2SE-1.4

I create a Maven project in Eclipse Helios. It works fine for a day, but then this warning shows up: Build path specifies execution environment J2SE-1.4. There are no JREs installed in the workspace that are strictly compatible with this…
narsereg
  • 1,483
  • 2
  • 11
  • 6