How to install Maven automatically in Linux continuous integration

How to install Maven automatically in Linux continuous integration

Unzip the Maven package

tar xf apache-maven-3.5.4-bin.tar.gz 

Move the unzipped Maven files to /usr/local/

mv apache-maven-3.5.4 /usr/local 

#!/bin/bash
#Maven installation directory mkdir /usr/maven
#Installation package placement directory cd /usr/src
http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/source/apache-maven-3.5.4-src.tar.gz
tar -xzvf apache-maven-3.5.4-bin.tar.gz
rm -f apache-maven-3.5.4-bin.tar.gz
mv apache-maven-3.5.4/* /usr/maven
#Configure environment variable PROFILE=$(cat /etc/profile)
PATH='export PATH=$PATH'
REPLACE='export PATH=$PATH:$MAVEN_HOME/bin'
#Is there already a configuration path for other environment variables if [[ $PROFILE == *$PATH* ]]
#Add variable path then echo "${PROFILE/$PATH/$REPLACE}" > /etc/profile
#Append the path to the end of the text else echo "$REPLACE" >> /etc/profile
fi
echo "export MAVEN_HOME=/usr/maven" >> /etc/profile
#Update the configuration file source /etc/profile
# View the mvn version mvn -version

Update Files

source /etc/profile

verify

mvn -v 

At this point, the Maven installation is complete.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • How to modify the default Python version when installing Python on Linux
  • Summary of methods to check whether the port is open in Linux
  • MySQL 8.0.15 installation and configuration graphic tutorial and password change under Linux
  • Linux CentOS6.9 installation graphic tutorial under VMware
  • Solution to MySQL garbled code problem under Linux
  • Summary of methods for creating, listing, and deleting Docker containers on Linux
  • Solution to the problem that Linux cannot connect to the Internet in VMware after the computer shuts down unexpectedly
  • How to view available network interfaces in Linux
  • Linux system to view CPU, machine model, memory and other information
  • Solution to the failure of loading dynamic library when Linux program is running

<<:  Introduction to fuzzy query method using instr in mysql

>>:  WeChat applet implements video player sending bullet screen

Recommend

Detailed explanation of the use of props in React's three major attributes

Table of contents Class Component Functional Comp...

JavaScript recursion detailed

Table of contents 1. What is recursion? 2. Solve ...

Summary of MySQL character sets

Table of contents Character Set Comparison Rules ...

...

Detailed explanation of MySQL sql99 syntax inner join and non-equivalent join

#Case: Query employee salary levels SELECT salary...

Vue implements page caching function

This article example shares the specific code of ...

How to use pdf.js to preview pdf files in Vue

When we preview PDF on the page, some files canno...

Detailed explanation of Vue's hash jump principle

Table of contents The difference between hash and...

Examples of new selectors in CSS3

Structural (position) pseudo-class selector (CSS3...

Detailed explanation of the use of this.$set in Vue

Table of contents Use of this.$set in Vue use Why...

Implementation of CSS Fantastic Border Animation Effect

Today I was browsing the blog site - shoptalkshow...

Table paging function implemented by Vue2.0+ElementUI+PageHelper

Preface I have been working on some front-end pro...

When to use table and when to use CSS (experience sharing)

The main text page of TW used to have a width of 8...