title: JDK 9: JUnit 5 test compile with SpringExtension produces java.lang.NoClassDefFoundError: org/w3c/dom/ls/DocumentLS
body: <p>I believe this problem not to be related to module exclusions in JDK 9 (as with java.se.ee), but rather with the fact that JDK 9 includes a newer version of <a href="http://download.java.net/java/jdk9/docs/api/org/w3c/dom/ls/package-summary.html" rel="noreferrer">org.w3c.dom.ls</a> in the <a href="http://download.java.net/java/jdk9/docs/api/java.xml-summary.html" rel="noreferrer">java.xml</a> module that does not have the DocumentLS class. </p>
  
  <p>The important bit of the stack trace is this:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-test/test-container.xml]; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ls/DocumentLS
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
  </code></pre>
  
  <p>Even if I include a runtime dependency with this class, like <code>xerces:xerces 2.4.0</code>, the JDK java.xml module is preferred (I guess).</p>
  
  <p>I am using Gradle 4.1. Is there any way to restrict the scope of a 
  JDK provided module?  </p>