Sonar scans Java, JS, JSP technology

Source: Internet
Author: User

Recently in the sonar scan of things, has been only scanning Java code, so that the statistics of the data escalation leader many developers do not obey (say I do not have to write JSP to write JS? ),

So good, so continue to the whole sonar, in the official website to see Sonar actually has JS, JSP plug-in, so that you can achieve the scan JS and JSP.

Installing the sonar server here's no detail.

To scan JS, JSP that must give sonar server add plug-in, add-ons can be added in the Sonar Update center, you can also download the jar package to the sonar plugins

1) JavaScript code check: Http://docs.codehaus.org/display/SONAR/JavaScript+Plugin

2) Web page check (HTML, JSP, JSF, Ruby, PHP, etc.): Http://docs.codehaus.org/display/SONAR/Web+Plugin

First, MAVEN project scan Java, JS, JSP

Sonar provides the integration of MAVEN, so MAVEN project scan is very simple (sonar integrated MAVEN does not elaborate here, online a lot of articles)

So sonar how to scan the information of three languages, very simple, configuration pom.xml, the resource path of sonar scan into Java, JSP, JS the root path of the resource is finished

<properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    < Sonar.sources>src</sonar.sources></properties>

After scanning sonar shows the situation:

Second, general Web project scanning

General projects recommend using Sonar-runner,sonar-runner and sonar integration to achieve the scanning effect,

Here you need to configure sonar-project.properties and then use Sonar-runner to scan

#required metadata  #projectKey项目的唯一标识, cannot repeat sonar.forceauthentication=falsesonar.login=saqsonar.password= 000000 sonar.projectkey=testusersonar.projectname=testusersonar.projectversion=1.0   sonar.sourceEncoding= UTF-8  sonar.modules=java-module,javascript-module,html-module   # java Module  Java-module.sonar.projectname=java module  Java-module.sonar.language=java  #. Indicates the directory  projectbasedir specified java-module.sonar.sources=.  Java-module.sonar.projectbasedir=src/main/java  sonar.binaries=classes  # JavaScript Module  Javascript-module.sonar.projectname=javascript Module  javascript-module.sonar.language=js  Javascript-module.sonar.sources=js  Javascript-module.sonar.projectbasedir=src/main/webapp   # Html Module  html-module.sonar.projectname=html module  html-module.sonar.language=web  Html-module.sonar.sources=pages  Html-module.sonar.projectbasedir=src/main/webapp

Sonar scans Java, JS, JSP technology

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.