To download Maven, navigate to https://maven.apache.org/download.cgi and click on the For Linux/Unix/Mac Binary tar.gz download file to install the latest version of Apache Maven.
Once you have downloaded the tar.gz file, extract it to a new local directory on your computer (Example:
/usr/apps/apache-maven-3.6.2
), then add the maven-3.6.2/bin directory to your PATH.
To add the directory to your PATH:
export PATH=$PATH:/usr/apps/apache-maven-3.6.2/bin
Note: This command will not permanently update your PATH for the remainder of the session. To permanently update your
PATH edit your ~/.profile
or ~/.bashrc
file and add the export
command as shown above, and then run either source ~/.profile
or source ~/.bashrc
Verification is an essential aspect of the Maven installation process, and there are three things you need to check:
To verify that you have correctly added the maven-3.6.2/bin folder to your PATHs, type env
in your Terminal or Linux command to display
all your available PATHs. Verify that the pat you added is shown.
For Maven to run correctly, Java must be installed on your Linux/Unix/Mac machine. To verify that Java is installed on your computer:
java -version
If you see the error -bash: java: command not found
, then you need to either install Java, or you need to add the location of the Java executable to your PATH.
To install Java on your computer:Finally, verify that Maven is working correctly. To run the command:
mvn –v
Now that you have installed Maven, you can set up a new Maven project and see how to use the Liquibase Maven plugin in that project.