go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » Ubuntu » How To Install Apache Maven on Ubuntu 16.04 Box
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: How To Install Apache Maven on Ubuntu 16.04 Box
Linux
member
offline   
 
posts: 120
joined: 01/24/2011
from: San Jose, CA
  posted on: 10/28/2017 05:48:30 AM    Edit  |   Quote  |   Report 
How To Install Apache Maven on Ubuntu 16.04 Box

Why Maven instead of Ant?

  • Convention over Configuration -- all Maven projects have a common structure, which makes it easier to understand each project.
  • Better dependency management -- Maven projects do not need to store third-party binary libraries in source control.
  • Easier to build huge project with multiple sub-projects.

    Prerequisites

  • Java JDK installed and JAVA_HOME has been set up. Check here for details.


  •  Profile | Reply Points Earned: 0
    Linux
    member
    offline   
     
    posts: 120
    joined: 01/24/2011
    from: San Jose, CA
      posted on: 10/28/2017 06:29:57 AM    Edit  |   Quote  |   Report 
    Install Apache Maven

    Step 1) Download the Apache Maven package

    First go to http://maven.apache.org/download.cgi, find the tar.gz under Binary Distributions and download it to local Windows machine.

    Step 2). Make the folder available
    $ sudo mkdir /opt/maven
    $ cd /opt
    $ sudo chmod 777 maven
    


    Step 3). Upload the downloaded package by WinSCP

    Copy apache-maven-3.5.2-bin.tar.gz onto /opt/maven

    Step 4). Unzip the package
    $ cd /opt/maven
    $ tar xzf apache-maven-3.5.2-bin.tar.gz
    


    The Maven content is under folder /opt/maven/apache-maven-3.5.2

    Step 5). Verify it is working
    $ cd /opt/maven/apache-maven-3.5.2
    $ ./bin/mvn --version
    Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T00:58:13-07:00)
    Maven home: /opt/maven/apache-maven-3.5.2
    Java version: 1.8.0_152, vendor: Oracle Corporation
    Java home: /usr/local/java/jdk1.8.0_152/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "4.10.0-37-generic", arch: "amd64", family: "unix"
    


    Step 6). Install Maven Linkage

    Format:
    $ update-alternatives --install <link> <name> <path> <priority>
    


    To create a link /usr/bin/mvn named mvn pointing to executable file /opt/maven/apache-maven-3.5.2/bin/mvn
    $ sudo update-alternatives --install /usr/bin/mvn mvn /opt/maven/apache-maven-3.5.2/bin/mvn 100
    

     Profile | Reply Points Earned: 0

     
    Powered by ForumEasy © 2003-2005, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.