Upgrade guide
Upgrade server 升级服务
Stop the current Sonar server 1停止sonar服务
bin/[OS]/sonar.sh stop
Ctrl-C on Windows
Unzip the new version of Sonar in a fresh directory, let's say {$NEW_SONAR_HOME} 2将新版本解压至一新目录下
Copy sonar.properties and wrapper.conf files from {$OLD_SONAR_HOME}/conf to {$NEW_SONAR_HOME}/conf or configure sonar.properties 3 将sonar.properties和wrapper.conf files从旧版本拷贝至新版本或重新配置
If you use rules extensions or your own jdbc drivers, copy the corresponding directories into /extensions from {$OLD_SONAR_HOME} to {$NEW_SONAR_HOME} 4 如果你使用拓展的条例或自己的数据库连接,从旧版本的/extension拷贝到新版本相对应的位置
If you are using Sonar plugins, you should copy them to the new instance. Check the compatibility between Sonar core and the plugin before doing so. 5 如果你使用sonar插件,你应该也将他们拷贝到新版本.在此之前,应该检查souar核和此插件间的兼容性
Backup your database 6 备份你的数据库
If Sonar is deployed on a JEE application server, repackage the WAR file by executing the script /war/build-war 7 如果sonar部署到一个JEE应用服务器上,执行/war/build-war脚本,来重新打包WAR文件
Start the server (or restart the application server) 8 开始服务(或重启应用服务器)
bin/[OS]/sonar.sh start
bin/windows-x86-32/StartSonar.bat on windows
Browse to http://localhost:9000 and follow setup instructions. 9 浏览地址并参照设置说明
Launch project analysis to refresh data. 10 重新发布项目分析来刷新数据
|
Upgrade process 升级过程中 Upgrade process can take a while depending on the size of projects portfolio. Make sure that nobody accesses Sonar and do not refresh the web page during setup. The web page will be refreshed automatically at the end of upgrade. To monitor the process, checks the logs and / or the console. 升级过程 所需一定时间取决于工程文件的大小,确保此时没人进入sonar且没有刷新web界面.在升级最后web界面将自动刷新.为监视这个过程,可检查/logs或控制台信息. Migration is completed when an analysis has been run on project. Only at that point will you get new functionality working for sure. 当工程的数据分析已经可运行出时.迁移完成.只有此时你才能得到完整的新功能. The first analysis after migrating to 1.11 can be very long, due to a new purge mechanism that was added. 迁移到1.11版本后的第一次数据分析过程都会比较长,是由于添加了一个新的错误消除方法. |
Upgrade Maven plugin
Since release 1.8, you don't have to do anything to upgrade the Sonar Maven plugin. Command is :
mvn sonar:sonar
从1.8开始.升级sonar-maven插件
To find more about new Maven parameters, check the Advanced parameters section
有更多新的maven参数可以选择
Deploy on application server 部署在应用服务器上
Sonar can be packaged as a WAR then deployed into an existing J2EE application server. To use this method of installation, you must already know how to deploy a web application on the application server of choice. Sonar能被打为war包然后部署至一个已存在的J2EE应用服务器.要使用这种方式去安装,你必须已经知道如何在一个可选的应用服务上去部署一个web应用.
Supported servers 支持的服务器
The only supported servers are Tomcat 5.x and 6.x. 只支持Tomcat5.x和6.x
Installation 安装
Steps are :
· edit conf/sonar.properties as described in standalone mode. The file conf/wrapper.conf is never used when deploying to application server. 以描述的标准模型编辑conf/sonar.properties,文件conf/wrapper.conf 当部署至应用服务器时未被使用.
· execute the script build-war.sh (or build-war.bat on MS Windows) from the directory war/ 在war/目录下,执行build-war.sh(或在windowsOS上执行build-war.bat)
· deploy war/sonar.war to the application server 部署war/sonar.war至应用服务器
· browse to http://localhost/sonar and follow setup instructions 进入网址,然后参照配置说明
|
A minimum heap size of 512Mo is required.512m是所需最小的堆栈容量 |
|
|
The WAR file must be rebuilt each time the configuration is updated (conf/sonar.properties or new extensions). WAR文件在每次重新配置(conf/sonar.properties改变或有新的扩展)时必须重建 |
|
Tomcat notes
To increase memory heap size, set the CATALINA_OPTS variable before starting Tomcat :为增加内存,在启动Tomcat前设置CATALINA_OPTS参数
CATALINA_OPTS="-Xms1024m -Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m"
More details on this blog.