IDEA集成Gerrit
Gerrit是一个代码托管平台,与gitee、gitlab相似,但是具有代码审核功能,在devops、代码质量管控方面比较有用,本文介绍开发工具IDEA如何集成Gerrit。
基础环境
IDEA,版本IntelliJ IDEA 2020.2.4
Git,git version 2.33.1
Gerrit,安装版本gerrit-3.1.2.war
安装Gerrit
File -> Settings -> Plugins,搜索Gerrit,如果没有安装,就选择install,安装完成后重启IDEA
配置Gerrit
File -> Settings -> Version Control,输入Gerrit web-ui登录地址以及账号密码
测试连接
如果出现401或者RestApiExcetion等,去gerrit的安装服务器上,修改gerrit.config文件,将localhost或127.0.0.1等配置替换为服务器ip,然后重启gerrit
[gerrit] basePath = /gerrit/gerrit_repo canonicalWebUrl = http://192.168.1.161:8081 serverId = f3d5003a-aee7-4762-9f66-405d555ca2ec [container] javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance" javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance" user = root javaHome = /data/server/jdk/jre [index] type = lucene [auth] type = HTTP [receive] enableSignedPush = false [sendemail] smtpServer = smtp.163.com smtpServerPort = 25 smtpUser = liao535299@163.com [sshd] listenAddress = *:29418 [httpd] listenUrl = proxy-http://*:8081/ [cache] directory = cache [plugins] allowRemoteAdmin = true