gabord
3/16/2018 - 4:59 PM

Use SonarQube locally

  1. Install SonarQube to local server by the tutorial
  2. Generate security token from admin panel
  3. Update pom.xml with the below details
  4. Run sonar update with mvn sonar:sonar

Alternatively, we can supply the username in <sonar.login> (instead of token) and password in <sonar.password>

<dependencies>
		<dependency>
			<groupId>org.codehaus.sonar</groupId>
			<artifactId>sonar-maven-plugin</artifactId>
			<version>5.1</version>
		</dependency>
</dependencies>

<profiles>
		<profile>
			<id>sonar</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<!-- Optional URL to server. Default value is http://localhost:9000 -->
				<sonar.host.url>
					http://localhost:9010
				</sonar.host.url>
				<sonar.login>d3f8e3c841cdbf98c97ae7bb1ef8ad8a4d6458c6</sonar.login>
			</properties>
		</profile>
	</profiles>