title: Cannot find xsd in src/main/resources in unit test on CLI only
body: <p>I have a test XML file that is used in my unit tests, that references a schema which is in <code>src/main/resources</code>.  When I run the tests in IntelliJ, the schema in <code>src/main/resources</code> is successfully added to the classpath:</p>
  
  <pre><code>DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.meanwhileinhell.com/mih/schemas/spring/core-admin.xsd] in classpath: com/meanwhileinhell/mih/admin/core/spring/jbox-core-admin.xsd
  </code></pre>
  
  <p>However, when I run on my command line with Gradle, it cannot find the XSD, and I get a SAXException:</p>
  
  <pre><code>org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document
  'http://www.meanwhileinhell.com/mih/schemas/spring/core-admin.xsd', because 1) could
  not find the document; 2) the document could not be read; 3) the root element of the
  document is not &lt;xsd:schema&gt;.
  
  java.lang.IllegalStateException: Failed to load ApplicationContext
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
    wildcard is strict, but no declaration can be found for element 'service-info'.
  </code></pre>
  
  <p>--</p>
  
  <pre><code>src
    test
      resources
        - test-service-info.xml
  </code></pre>
  
  <p><strong>test-service-info.xml</strong></p>
  
  <pre><code>xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                      http://www.meanwhileinhell.com/mih/schemas/spring/core-admin http://www.meanwhileinhell.com/mih/schemas/spring/core-admin.xsd
  
  
  &lt;mih:restlet-application id="testApplicationId"
      name="testApplication" matchingMode="2"&gt;   &lt;&lt;&lt; Line 16, column 49 is after the `&gt;`
  </code></pre>
  
  <p>--</p>
  
  <pre><code>src
    main
      resources
        - mih-core-admin.xsd
  </code></pre>
  
  <p><strong>mih-core-admin.xsd</strong></p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      targetNamespace="http://www.meanwhileinhell.com/mih/schemas/spring/core-admin"
      xmlns:core_admin="http://www.meanwhileinhell.com/mih/schemas/spring/core-admin"&gt;
  </code></pre>
  
  <p>This isn't a naming issue between <code>mih-core-admin.xsd</code> and <code>core-admin</code>.  Also, when I add the same xsd to <code>src/test/resources</code> and <code>src/test/resources/spring</code> it still cannot find it.</p>
  
  <p>Gradle version for both IJ and CLI: 4.10.2</p>
  
  <h1><strong>EDIT</strong></h1>
  
  <p>I've tried adding the following to the <code>build.gradle</code> for the project, but still no file on the classpath:</p>
  
  <pre><code>sourceSets {
    test {
      resources {
        srcDirs = ['src/test/resources', 'src/main/resources/'] 
      }
    }
  }
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>sourceSets {
    test {
      resources {
        srcDir 'src/test/resources'
        include 'src/main/resources/mih-core-admin.xsd'
      }
    }
  }
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>sourceSets {
    test {
      output.resourcesDir = "build/resources/main"
    }
  }
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>sourceSets.main.compileClasspath
  </code></pre>
  
  <p>Also tried using <code>build/resources/main</code> rather than <code>src/main/resources</code> in above examples.</p>