Apache Maven is a build automation tool primarily used for Java projects. This tutorial will guide you through the steps to install Apache Maven on Void Linux.
Before beginning this tutorial, ensure that you have the following:
First, update the package repositories on your system.
sudo xbps-install -Su
Apache Maven requires a Java Development Kit (JDK) to run. You can install the latest version of OpenJDK on Void Linux using the following command.
sudo xbps-install -S openjdk
Download the latest version of Apache Maven from the official website using the following command.
sudo curl -O https://www-us.apache.org/dist/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.tar.gz
Next, extract the downloaded file to the /opt directory using the following command.
sudo tar -xzvf apache-maven-3.8.3-bin.tar.gz -C /opt/
Set the environment variables for Apache Maven by creating a new file named maven.sh
in the /etc/profile.d/ directory using the following command.
sudo nano /etc/profile.d/maven.sh
Add the following lines to the file:
export M2_HOME=/opt/apache-maven-3.8.3
export PATH=${M2_HOME}/bin:${PATH}
Save and close the file.
Reload the system environment to confirm the installation.
source /etc/profile.d/maven.sh
Congratulations, Apache Maven is now installed on your Void Linux system. You can verify the installation by running the following command.
mvn -version
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!