1.安裝maven
下載地址:http://maven.apache.org/download.cgi
2.配置環境變量
解壓文件,放到Library文件下
配置環境變量
編輯文件:open ~/.bash_profile
# maven 環境變量
export M3_HOME=/Library/apache-maven-3.6.3
export PATH=$PATH:$M3_HOME/bin
生效文件:source ~/.bash_profile
執行:mvn -version,驗證配置生效
3.修改配置文件
修改maven中的conf-settings配置文件
<pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://127.0.0.1:9000
</sonar.host.url>
</properties>
</profile>