HudsonIs a scalable continuous integration engine. It is mainly used for: continuous and automatic construction/testing of software projects. It monitors some scheduled tasks.
SonarIt is an open-source quality management platform that focuses on continuous analysis and measurement technology quality from projects to class methods. It integrates code quality-related software for unified management;
To put it simply,
HudsonIs a continuous, automatic building/testing software project,
WhileSonarIt is continuous and automatic statistics and analysis of quality data related to software projects, such as pass rate, coverage rate, Code complexity, number of lines of code, and so on, used to evaluate and measure the quality of software projects.
Hudson:
Http://hudson-ci.org/
Sonar:
Http://www.sonarsource.org/
Build:
1. installation:
1) download the latest version (which is packaged as a war file ). Hudson Official Website: http://hudson-ci.org/
2) Runjava -jar hudson.war
Note: Hudson needs to run Java 5 or a later version.
Another installation method is to deploy the downloaded war package file to the servlet container and start the container. In the URL address bar of the browser, enter a file similar to http: // localhost: 8088/Hudson. Is the interface after the installation is successful (using the XP + Tomcat + java5 environment ):
2. Start: Enter/home/username/Apache-Tomcat-6.0.20/bin in the server directory.
Run the shutdown. Sh or startup. Sh script to restart or stop the instance.
3. System Configuration:
On the running Hudson homepage, choose System Management> system settings on the left:
On the system configuration page, the first item in this list isHome directory. This includes all the workspaces that Hudson wants to execute and all the configurations that store it.
To configure a JDK and maven2 instance, clickAddClick to add the Instance name and absolute address.
We recommend that you do not select the install automatically option, but enter the installation path of your local Java and maven2 and name it.
Next, we will introduce the meaning of other text information on this page:
System. Message enter instructions
Quiet Period: the time (in seconds) for Hudson to regularly build the project)
Enable Security: Set logon rules for Hudson (Anonymous logon by default). For details, see the following description.
TCP port for JNLP slave agents: I don't know what JNLP is. In short, there are three methods: fixed (fixed) random (Radom) not used (Disabled). When fixed, JNLP information can be entered.
Security realm: You can use middleware containers, databases, and LDAP to verify security,
Authorized: authentication methods that allow you to set identities: system users, anonymous users, Custom Users, and inherited users (anonymous users are also recommended in this study)
JDK installations: Set the JDK installation path
Shell executable: Set the window shell command
Ant installation: Set the installation path of ant
Set Mave installation path
CVS executable: Specifies the route (cvs.exe) of the cvsnt execution process)
. Cvspass file: set the path of the cvsnt administrator file (passwd file)
E-mail Notification: Set the email address sent when an error occurs.
Hudson URL: the default address of Hudson.
You can also configure other aspects of the server, such as providing the location of an email server to Hudson to receive emails when the build fails. You may need to ask the system administrator to help set this feature based on your organization's email setting method. Setting email is not required; Hudson also supports RSS as a notification mechanism, which is better for some people than email. The notification mechanism you choose depends on you.
Build:
1. Download
Download the sonar package from the official website and unzip it to any directory http://www.sonarsource.org/downloads/.
2. Mysql Database Installation
Go to the SQL Web site to download mysql rpm package: MySQL-client-community-5.1.45-1.rhel5.i386.rpm and MySQL-server-community-5.1.45-1.rhel5.i386.rpm
Respectively
Rpm-ivh MySQL-server-community-5.1.45-1.rhel5.i386.rpm
3. log on to mysql. The initial username and password of mysql are root/empty.
Normal logon is mysql-u root-p
CREATE USER
Sonar @ localhost identified by 'sonar;
Grant select, insert, update, delete, create on *. * to sonar @ "localhost" Identified by "sonar ";
4. Create a database
Sonar uses the embedded Derby database by default. to migrate to Mysql, you must first create a mysql database for the sonar/sonar UTF-8 and authorize access to the sonar Database
Root User
Mysql> create database sonar character set utf8 COLLATE utf8_general_ci;
Mysql> grant all privileges on sonar. * to 'sonar '@' % 'identified by 'sonar ';
Mysql> flush privileges;
5. Modify the confsonar. properties file:
Properties code:
Sonar. jdbc. url: jdbc: mysql: // server IP Address: 3306/sonar? UseUnicode = true & characterEncoding = utf8
Sonar. jdbc. driver: com. mysql. jdbc. Driver
Sonar. jdbc. validationQuery: select 1
5. Modify settings. Xml of the maven plug-in on the server and add the following configuration information.
[Xhtml: nogutter]
View plaincopy
- <Profile>
- <Id> sonar </id>
- <Activation>
- <ActiveByDefault> true </activeByDefault>
- </Activation>
- <Properties>
- <Sonar. jdbc. url>
- JDBC: mysql: // localhost: 3306/sonar? Useunicode = true & amp; characterencoding = utf8
- </Sonar. JDBC. url>
- <Sonar. JDBC. Driver> com. MySQL. JDBC. Driver </sonar. JDBC. Driver>
- <Sonar. JDBC. Username> sonar </sonar. JDBC. Username>
- <Sonar. JDBC. Password> sonar </sonar. JDBC. Password>
- <Sonar. Host. url> http: // 10.108.19.90: 9000 </sonar. Host. url>
- </Properties>
- </Profile>
Sonar plug-in Installation
1. Choose Hudson System Management> plug-in management, as shown in figure
2. Go to "available plug-ins", select the sonar (Hudson Sonar Plugin) plug-in, and click Install in the lower-right corner of the page, as shown in figure
3. A message is displayed on the page indicating that the sonar plug-in has been installed.
4. Restart hudson and the plug-in will take effect.
Sonar plug-in configuration
1. Choose Hudson> System Management> system configuration, as shown in figure
Http: // 10.108.19.90/hudson/configure
2. On the system configuration page, find Sonar, for example, the system information for configuring sonar.
3. After completing the above configuration, Hudson + Sonar will be integrated.