title: Deorg.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
body: <p>I'm using the Xerces jar in a gradle project, I use then the jar of this project inside a gradle plugin: In fact, I'm developing a gradle plugin with custom tasks that use some functions of the gradle project jar; when I try to run the tasks, I have this error; however when I try to run the function from the gradle project it works correctly. When I tried to search on the net, I found that the cause of the error is that the JRE packages a version of Xerces but I don't know how to resolve the problem...</p>
  
  <p>dependencies block of my gradle project:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"      
      }
  }
  
   dependencies {
  
  testImplementation 'junit:junit:4.12'
  testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
  implementation (group: 'commons-logging', name: 'commons-logging', version: '1.2')
  implementation(group: 'log4j', name: 'log4j', version: '1.2.17')
  implementation (group: 'javax', name: 'javaee-api', version: '8.0') 
  implementation group: 'org.hibernate', name: 'hibernate-core', version: '5.2.17.Final'
  implementation (group: 'commons-io', name: 'commons-io', version: '2.6')
  implementation(group: 'org.apache.ant', name: 'ant', version: '1.10.3')  
  implementation( group: 'xerces', name: 'xercesImpl', version: '2.11.0')
  implementation (group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3')
  implementation( group: 'net.sf.jt400', name: 'jt400', version: '9.5') 
  implementation(group: 'mysql', name: 'mysql-connector-java', version: '5.0.4') 
  implementation (group: 'org.apache.derby', name: 'derbyclient', version: '10.14.2.0')
  implementation group: 'com.oracle', name: 'ojdbc6', version: '11.2.0.3' 
  
  
  implementation group: 'Ext', name: 'sqljdbc', version: 'sqljdbc'
  implementation group: 'toplink.essentials', name: 'toplink-essentials', version: '2.1-60',transitive:false
  implementation group: 'org.springframework', name: 'spring', version: '2.5.6' 
  implementation group: 'org.swinglabs', name: 'swing-layout', version: '1.0.3'
  implementation group: 'xalan', name: 'xalan', version: '2.7.2'
  implementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.6.6'
  implementation group: 'org.gradle', name: 'gradle-tooling-api', version: '4.3'
  implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
  implementation group: 'org.hibernate', name: 'hibernate-cglib-repack', version: '2.1_3'
  
  implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
  
  implementation group: 'xml-apis', name: 'xml-apis', version: '1.4.01'
  implementation (group: 'xalan', name: 'serializer', version: '2.7.2')
  implementation(group:'org.apache.ant', name: 'ant-launcher', version: '1.10.3')
  </code></pre>
  
  <p>}</p>
  
  <p>Here is the Build.gradle of my gradle plugin:</p>
  
  <pre><code>group = 'CustomPlugin'
  apply plugin: 'java'
  apply plugin: 'groovy'
  apply plugin: 'maven'
  apply plugin: 'maven-publish'
  apply plugin: 'com.jfrog.artifactory'
  archivesBaseName ='CustomPluginGradle'
  version='10.0.0'
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"      
      }
  }
  
  artifactory {
  contextUrl = "${artifactory_contextUrl}" 
      publish {
          repository {
              repoKey = 'repo-local'
              username = "${artifactory_user}"
              password = "${artifactory_password}"
              maven = true
          }
          defaults {
               publishConfigs('archives', 'published')  
               publishBuildInfo = false 
               publishArtifacts = false
               publishPom = true
               publishIvy = false
  
          }
      }
      resolve {
          repository {
              repoKey = 'repo-local'
              username = "${artifactory_user}"
              password = "${artifactory_password}"
              maven = true
  
          }
      }
  }
  
  publishing {    
    publications {   
       mavenJava(MavenPublication) { 
           from components.java  
        } 
        CustomPluginGradle(MavenPublication) {
            group='CustomPlugin'
         } 
     }
  }
  jar {
  from ('src/main/java'){
  exclude '**/**.java'}
  }
  
  
  repositories {
      jcenter()
  }
  
  dependencies {
      compile gradleApi()
      testImplementation 'junit:junit:4.12'
      testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
      implementation (group: 'commons-logging', name: 'commons-logging', version: '1.2')
      implementation(group: 'log4j', name: 'log4j', version: '1.2.17')
      implementation (group: 'javax', name: 'javaee-api', version: '8.0') 
      implementation group: 'org.hibernate', name: 'hibernate-core', version: '5.2.17.Final'
      implementation (group: 'commons-io', name: 'commons-io', version: '2.6')
      implementation(group: 'org.apache.ant', name: 'ant', version: '1.10.3')  
      implementation( group: 'xerces', name: 'xercesImpl', version: '2.11.0')
      implementation (group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3')
      implementation( group: 'net.sf.jt400', name: 'jt400', version: '9.5') 
      implementation(group: 'mysql', name: 'mysql-connector-java', version: '5.0.4') 
      implementation (group: 'org.apache.derby', name: 'derbyclient', version: '10.14.2.0')
      implementation group: 'com.oracle', name: 'ojdbc6', version: '11.2.0.3' 
  
      implementation group: 'Ext', name: 'sqljdbc', version: 'sqljdbc'
      implementation group: 'toplink.essentials', name: 'toplink-essentials', version: '2.1-60',transitive:false
      implementation group: 'org.springframework', name: 'spring', version: '2.5.6' 
      implementation group: 'org.swinglabs', name: 'swing-layout', version: '1.0.3'
      implementation group: 'xalan', name: 'xalan', version: '2.7.2'
      implementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.6.6'
      implementation group: 'org.gradle', name: 'gradle-tooling-api', version: '4.3'
      implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
      implementation group: 'org.hibernate', name: 'hibernate-cglib-repack', version: '2.1_3'
  
      implementation group: 'xml-apis', name: 'xml-apis', version: '1.4.01'
      implementation (group: 'xalan', name: 'serializer', version: '2.7.2')
      implementation(group:'org.apache.ant', name: 'ant-launcher', version: '1.10.3')
  }
  
  configurations.all {
      transitive = false
  }
  
  configurations.all {
  resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
  }
  </code></pre>