SonarQube Jacoco JUnit : SonarScanner get many unexpected problems
<p>I have a simple project that need to Run JUnit test and let SonarQube to scan / run the Test of JUnit result with SonarScanner. I put my project at <a href="https://github.com/daviduck123/sonar-jacoco-JUnit-Maven" rel="nofollow noreferrer">Github here</a></p>

<p>There are some problems:</p>

<ol>
<li>WARN: Class "XXX" is not accessible through the classloader sonar (<a href="https://stackoverflow.com/questions/31593240/class-not-found-error-when-running-sonarrunner">Reference</a>)</li>
<li>No jacoco-it.exec and jacoco-ut.exec, only run jacoco.exec at SonarScanner</li>
<li>Cannot exclude some files when running Test JUnit, because I only want to Run Test in my Service Folder (<a href="http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreFiles" rel="nofollow noreferrer">Reference</a>)</li>
</ol>

<p>This is my sonar-project.properties :</p>

<pre><code># Required metadata
sonar.projectKey=com.example:Sample
sonar.projectName=Java :: Example :: SonarQube Scanner
sonar.projectVersion=1.0

# Comma-separated paths to directories with sources (required)
sonar.sources=src
sonar.exclusions=src/main/resources/**
#sonar.test.inclusions=src/main/java/com/example/service/**, src/test/java/**
#sonar.test.exclusions=src/main/java/com/example/controller/**

# Encoding of the source files
sonar.sourceEncoding=UTF-8

#Jacoco
sonar.junit.reportsPath=target/surefire-reports
sonar.jacoco.reportPath =target/jacoco.exec
sonar.jacoco.reportMissing.force.zero=true
sonar.java.binaries=target/classes/**
#sonar.java.libraries=libs/**
</code></pre>

<p>When I Run Maven Test until build success, It create some files and folders in folder <strong>Target</strong>.</p>

<p><a href="https://i.stack.imgur.com/IItuD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IItuD.png" alt="enter image description here"></a></p>

<p>After that I run my SonarScanner to Scan my project, but I got those problems.</p>

<p>My question:</p>

<ol>
<li>How can I run my SonarQube Scanner without any WARN ?</li>
<li>How to exclude files properly when scanning JUnit result? Because I use the reference settings, and Coverage still scan the files</li>
<li>How to create jacoco-it.exec and jacoco-ut.exec and run it on SonarScanner?</li>
</ol>

<p>My project is based on this <a href="http://docs.sonarqube.org/display/PLUG/Code+Coverage+by+Unit+Tests+for+Java+Project" rel="nofollow noreferrer">Reference</a></p>