C/C++教程

CentOS 7 环境下部署 Maven、Node 和 SonarScanner

本文主要是介绍CentOS 7 环境下部署 Maven、Node 和 SonarScanner,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
# 安装 OpenJDK
sudo yum -y install java-11-openjdk-devel

# 安装 Apache Maven
wget https://downloads.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.zip
sudo unzip apache-maven-3.8.5-bin.zip -d /opt

sudo vim /etc/profile.d/apache-maven.sh
  export PATH=/opt/apache-maven-3.8.5/bin:$PATH
source /etc/profile

sudo ln -s /opt/apache-maven-3.8.5/bin/mvn /usr/bin/mvn



# 安装 Node.js
wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz
sudo tar -xJvf node-v16.14.2-linux-x64.tar.xz -C /opt
sudo mv /opt/node-v16.14.2-linux-x64 /opt/node-v16.14.2

sudo vim /etc/profile.d/node.sh
  export PATH=/opt/node-v16.14.2/bin:$PATH
source /etc/profile

sudo ln -s /opt/node-v16.14.2/bin/node /usr/bin/node
sudo ln -s /opt/node-v16.14.2/bin/npm /usr/bin/npm



# 安装 CycloneDX Node.js Module
sudo npm install -g @cyclonedx/bom@2.0.2
sudo ln -s /opt/node-v16.14.2/bin/cyclonedx-bom /usr/bin/cyclonedx-bom



# 安装 SonarScanner
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747.zip
sudo unzip sonar-scanner-cli-4.7.0.2747.zip -d /opt
sudo mv /opt/sonar-scanner-4.7.0.2747 /opt/sonar-scanner-4.7

sudo vim /etc/profile.d/sonar-scanner.sh
  export PATH=/opt/sonar-scanner-4.7/bin:$PATH
source /etc/profile

sudo ln -s /opt/sonar-scanner-4.7/bin/sonar-scanner /usr/bin/sonar-scanner

这篇关于CentOS 7 环境下部署 Maven、Node 和 SonarScanner的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!