Aug 22, 2024
sudo apt update
sudo apt install maven
mvn -v
sudo apt remove maven
sudo apt update
sudo apt install openjdk-11-jdk
java -version
cd /tmp
wget [Maven download link]
tar -xvf apache-maven-x.x.x-bin.tar.gz
~/.bashrc
:
export MAVEN_HOME=/path/to/maven
export PATH=$PATH:$MAVEN_HOME/bin
source ~/.bashrc
mvn -v
sudo apt-get install gitlab-runner
gitlab-runner register
.gitlab-ci.yml
file in the repository:.gitlab-ci.yml
file content:
stages:
- build
- test
build:
script:
- mvn package
sonar:
script:
- mvn verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASSWORD