--Easy installation with brew
$ brew install sonarqube
--Maven is also installed with brew. So Java is the source for this analysis
$ brew install maven
--Postgre was already installed on my device, so create an account and skimmer --Account name: sonar --Password: sonar --Schema: sonar
--SonarQube settings
#
# sonar.properties location
#
$ pwd
/usr/local/Cellar/sonarqube/7.3/libexec/conf
#
# sonar.Properties settings
#
$ cat sonar.properties | grep -v "^#" | grep -v "^$"
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:postgresql://localhost:5432/sonar
sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000
sonar.path.data=/usr/local/Cellar/sonarqube/7.3/libexec/data
sonar.path.temp=/usr/local/Cellar/sonarqube/7.3/libexec/temp
--Launch SonarQube
$ sonar start
--Access SonarQube with your browser
http://localhost:9000/sonar
Previously, the setup didn't work and I was throwing it out, so this time I was upgrading from 7.2 to 7.3. Then, a message was displayed on the browser saying that the contents of the DB are also old and that you should upgrade. Again, I was in trouble because I didn't know how to do it, but when I looked at the log, a hint was output to the log. As supported, when I accessed / setup, the top page was displayed successfully ♪
$ pwd
/usr/local/Cellar/sonarqube/7.3/libexec/logs
$ tail sonar.log
################################################################################
      Database must be upgraded. Please backup database and browse /setup
################################################################################
http://localhost:9000/sonar/setup
--Source analysis
#
#Move to the directory of the Eclipse project that has the source analysis target
#
cd "Project directory"
#
#Command execution for preparation
#
$ mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=true
#
#Source analysis command
#
$ mvn sonar:sonar
An error occurred with the "mvn sonar: sonar" command. When I ran it in debug mode, it turned out that it failed because the path was different. (/ Sonar is not attached)
$ mvn sonar:sonar -X
ERROR: Sonar server 'http://localhost:9000' can not be reached
Add the following to maven setting.xml and re-execute the command, then BUILD SUCCESS !!!
<settings>
    <pluginGroups>
        <pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
    </pluginGroups>
    <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:9000/sonar
                </sonar.host.url>
            </properties>
        </profile>
     </profiles>
</settings>
--I was able to confirm the analysis result on the browser. By the way, the login ID and path was admin.
References
Recommended Posts