Questions tagged [maven-3]

Apache Maven is a build automation tool used primarily for Java projects. Use this tag for questions about installing and configuring Maven and Maven plugins in Ubuntu. Questions about programming are off topic and should be asked at http://stackoverflow.com/.

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.

61 questions
64
votes
9 answers

How to update maven 3.0.4 - 3.1.1

First of all am new to Ubuntu as well as Maven. Does anyone know how to update maven. My current version of maven is 3.0.4. I would like to update it to 3.1.1 which is the latest version. I tried sudo apt-get update maven but this didn't help…
suja
  • 751
  • 2
  • 6
  • 9
33
votes
8 answers

How do I install Maven 3?

Maven 2 is in the repositories, but not Maven 3. How do I properly install Maven 3? Guides that I found don't really work properly. I am using Natty, but I am sure this won't change anything.
nickguletskii
  • 4,870
  • 3
  • 22
  • 29
30
votes
2 answers

How to permanently set environmental variables PATH and M2_HOME in ubuntu for maven3?

I have downloaded the latest apache-maven3.zip file and extracted it to the folder: /home/gaurav/Java/maven3. I don't know how to set the environmental variables for maven - such as PATH and M2_HOME. I tried below things: export…
Gaurav Dighe
  • 722
  • 3
  • 11
  • 21
16
votes
1 answer

What is the correct way to install Maven and Eclipse?

I have installed Maven and Eclipse using the Software Center in Ubuntu 12.04. There is no sign of Maven integration in Eclipse. ("new Maven project" and such) What is the correct way to install? (to get Maven Eclipse integration)
Eero Aaltonen
  • 1,404
  • 3
  • 13
  • 33
11
votes
4 answers

When compiling a project, Maven throws an error

OS Linux - Ubuntu 20.04.2 LTS When compiling a project, Maven throws an error [ERROR] Error executing Maven. [ERROR] java.lang.IllegalStateException: Unable to load cache item [ERROR] Caused by: Unable to load cache item [ERROR] Caused by: Could not…
alex
  • 239
  • 1
  • 2
  • 7
7
votes
1 answer

apt-get install "maven" or "maven3"

I need some clarification on how to install the latest version of maven. When I run this command on a new Ubuntu 16.04 server machine (I haven't installed maven yet) I get the following message: vagrant@vagrant:~$ mvn The program 'mvn' is currently…
Ross
  • 73
  • 1
  • 1
  • 4
7
votes
3 answers

How to install previous version of Maven (3.0.4)?

The way my Maven packages are configured, something breaks when I have the latest version installed (I think 3.4). On another computer, where I have 3.0.4, the build runs fine. I am looking for a way to install a previous version using apt-get. I…
amphibient
  • 1,237
  • 4
  • 14
  • 21
4
votes
3 answers

Unable to remove maven using 'sudo apt-get remove maven2'

I want to upgrade to a newer version of maven. For that I first want to remove the existing version of maven in the computer as told here. I tried: sudo apt-get remove maven2 but it says: $ sudo apt-get remove maven2 Reading package lists...…
Sanchit Jain
  • 150
  • 1
  • 3
  • 13
4
votes
0 answers

Upgraded Java - Maven won't compile invalid target release: 11

I've recently upgraded Java from 1.8 to 11. mvn -version Maven home: /usr/share/maven Java version: 11.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en_NZ, platform encoding: UTF-8 OS name: "linux", version:…
beek
  • 201
  • 2
  • 7
3
votes
1 answer

Maven: JAVA_HOME is not defined correctly

I've installed and configured Maven and Java. I can successfully run mvn spring-boot:run But when I run sudo mvn spring-boot:run I am getting Maven: JAVA_HOME is not defined correctly When I do $ echo $JAVA_HOME /home/ubuntu/jdk1.8.0_26 Am I…
kranthi117
  • 173
  • 1
  • 8
3
votes
3 answers

Error: JAVA_HOME is not defined correctly - after maven installation

I installed Java JDK on Ubuntu 12.04 and added Java home to my path at ~/.bashrc: export PATH=/opt/jdk1.7.0_40/jdk1.7.0_40/bin:$PATH This looks a little bit strange but it's really my path. After this I installed maven through: sudo apt-get install…
catch23
  • 1,224
  • 9
  • 31
  • 42
3
votes
0 answers

Maven not working after updating java

I have recently updated my java version to jdk7u9 in my ubuntu 11.04 Natty after which my previous maven projects have stopped working. I have installed using this script When I run maven install in my projects (which previously used to work fine) I…
windwaker
  • 131
  • 2
2
votes
1 answer

When I redirect Maven commands, the file looks wrongly encoded

When I run a Maven command, it's normal in the terminal. But there is a problem when I redirect the output to a file like this: mvn install > file.log When I open the file, I see: [[1;34mINFO[m] Scanning for projects... [[1;34mINFO[m]…
Roknauta
  • 290
  • 3
  • 15
2
votes
0 answers

Performance issue with fresh install MySQL 5.616-1~exp1 (Ubuntu) on Ubuntu 16.04 LTS

I've recently started on a new company and I'm currently setting my dev environment. We're using Ubuntu 16.04 and MySQL 5.6 Everything was right until I launched the tests (using mvn test). After waiting more then 20 minutes, the tests were not…
Alfergon
  • 529
  • 5
  • 13
2
votes
1 answer

mvn package error: unknown host repo.maven.apache.org

I'm using intelliJ IDEA 14.1.4 and when mvn package is entered I get this message [INFO] Scanning for projects... [INFO] [INFO]…
Ivan DQ
  • 23
  • 1
  • 1
  • 6
1
2 3 4 5