In order to make the example work in IntelliJ you have to workaround a buggy issue in this IDE:
In the pom.xml of the example you have this section :
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
<type>sonar-plugin</type>
<version>1.5</version>
<scope>provided</scope>
</dependency>
(Assuming you don't have maven auto import feature enabled) In order to make it work in IntelliJ you have to comment out the line <type>sonar-plugin</type>
and click on the popup to import maven settings and then uncomment the line (but do not reimport settings).
This will make the library available in IntelliJ classpath and thus compiling the project.
To answer your other question :
There is a breaking change between version 4.1 and 4.2. Thus the break you encounter. As of when this will be updated, I might give it a shot this week, but no real guarantee on that, as we need to keep some example up for LTS version (3.7).