• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How To Install Apache Maven on Ubuntu Server

By Abhishek Ghosh July 9, 2018 9:26 pm Updated on July 9, 2018

How To Install Apache Maven on Ubuntu Server

Advertisement

Apache Maven is a Build Automation Tool. Alternative technologies is Gradle and sbt as build tools. We published guide on how to install Gradle. Maven needs XML file to build. Gradle and sbt do not rely on XML, but basic concept is like Maven introduced. Maven Needed For Many Big Data Software. Here Are the Steps on How To Install Apache Maven on Ubuntu Server. Maven takes care of two aspects of building software – describing how the software is built and its dependencies. Apache Ant is older and only exceptions need to be written down. Apache Ivy is next step of Apache Ant, Apache Maven, Gradle with dedicated dependency manager and support for Maven repositories. Still we need Maven instead of Ivy for many reasons. Maven projects are configured using a Project Object Model (POM), stored in a pom.xml file like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<project>
  <!-- model version is always 4.0.0 for Maven 2.x POMs -->
  <modelVersion>4.0.0</modelVersion>
  
  <!-- project coordinates, i.e. a group of values which
       uniquely identify this project -->
  
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0</version>
 
  <!-- library dependencies -->
  
  <dependencies>
    <dependency>
    
      <!-- coordinates of the required library -->
      
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      
      <!-- this dependency is only used for running and compiling tests -->
      
      <scope>test</scope>
      
    </dependency>
  </dependencies>
</project>

How To Install Apache Maven on Ubuntu Server

 

Steps To Install Apache Maven on Ubuntu Server

 

Update, Upgrade and install the software-properties-common package :

Vim
1
2
3
apt update -y
apt upgrade -y
apt install software-properties-common apt-transport-https -y

Add the ‘webupd8team’ PPA repository to the server :

Advertisement

---

Vim
1
2
sudo add-apt-repository ppa:webupd8team/java -y
apt upgrade

Install the Java 8 installer from the PPA repository :

Vim
1
apt install oracle-java8-installer -y

Accept the Oracle License by choosing the ‘YES’ button. Check the java version :

Vim
1
java -version

Download latest Apache Maven binary code. We are using /opt/apache-maven directory as the Maven home directory and Maben 3.5.3 as example.

Vim
1
2
3
4
cd /opt/
wget http://www-eu.apache.org/dist/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz
tar -xzvf apache-maven-3.5.3-bin.tar.gz
mv apache-maven-3.5.3/ apache-maven/

Go to the /etc/profile.d directory and create a new configuration file maven.sh :

Vim
1
2
cd /etc/profile.d/
nano maven.sh

Copy-paste the following configuration :

Vim
1
2
3
4
5
6
# Apache Maven Environment Variables
# MAVEN_HOME for Maven 1 - M2_HOME for Maven 2
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export M2_HOME=/opt/apache-maven
export MAVEN_HOME=/opt/apache-maven
export PATH=${M2_HOME}/bin:${PATH}

Save the changes and exit. Run the next needed commands :

Vim
1
2
chmod +x maven.sh
source maven.sh

To verify the maven installation, we can run the following Maven commands :

Vim
1
2
mvn --version
mvn --help

You will get official help, documentations at :

Vim
1
https://maven.apache.org/run.html

Tagged With How to Home Server , apache beam on ubuntu , install apache maven on ubuntu , maven service on server , ubuntu server spigot maven , ubuntu server spring maven
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How To Install Apache Maven on Ubuntu Server

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How to Install Apache Tika on Ubuntu Server

    Apache Tika is a Content Analysis Framework Which Can Be Configure With Web Software Like WordPress For Metadata Extraction of PDF, doc. Here is How to Install Apache Tika on Ubuntu Server.

  • How to Install Gradle on Debian

    Gradle is a build tool primarily used for Java projects. Gradle combines the features of Ant and Maven. Gradle uses Groovy, which is a dynamic, object-oriented programming language for the Java platform to define the project and build scripts. Java is one of the most popular programming languages used to build different kinds of applications […]

  • How to Install Gradle on Ubuntu 18.04 (Build Automation Toolset)

    Gradle is a Build Automation Toolset, Often Used to Install BigData Tools Related to Hadoop. Here is How to Install Gradle on Ubuntu 18.04 on Cloud Server.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy