Sonar Runner fails with Java 8

I’m running Gradle 1.11, and I’m unable to run the Sonar Runner plugin with Java 8. This looks like it’s due to the changes in JEP 185 - http://openjdk.java.net/jeps/185.

13:54:51.373 ERROR - Error parsing XML: XML InputStream(5) schema_reference: Failed to read schema document ‘persistence_1_0.xsd’, because ‘http’ access is not allowed due to restriction set by the accessExternalSchema property.

I’ve tried setting System.setProperty(‘javax.xml.accessExternalSchema’, ‘http’) both globally and within a tasks.withType(SonarRunner) closure, but neither works.

Any ideas?

Full error message:

:cpr_core:sonarRunner 13:54:50.951 INFO - Load batch settings 13:54:51.023 INFO - User cache: /Users/dvm105/.sonar/cache 13:54:51.028 INFO - Install plugins 13:54:51.050 INFO - Install JDBC driver 13:54:51.054 WARN - H2 database should be used for evaluation purpose only 13:54:51.054 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost:9092/sonar 13:54:51.315 INFO - Initializing Hibernate 13:54:51.373 ERROR - Error parsing XML: XML InputStream(5) schema_reference: Failed to read schema document ‘persistence_1_0.xsd’, because ‘http’ access is not allowed due to restriction set by the accessExternalSchema property.

:cpr_core:sonarRunner FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:cpr_core:sonarRunner’. > javax.persistence.PersistenceException: Unable to configure EntityManagerFactory

The ‘sonar-runner’ plugin is based on the Sonar Runner library. As the error is thrown by that library, I recommend to bring this up on the Sonar mailing list. If the Sonar folks conclude that something needs to be changed on our side, please let us know.