Java 应用程序无法使用一个Jar找到XSD文件

Java 应用程序无法使用一个Jar找到XSD文件,java,maven,xsd,executable-jar,Java,Maven,Xsd,Executable Jar,我使用一个Jar的maven插件将我的java打包到一个Jar中,其中包含所有依赖项 该项目有一个名为schema.xsd的资源 当我使用java-jarmyjar.one jar运行jar文件时,我得到以下错误: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jar:file:/../lib/myJar.one-jar.jar!/lib/myJar.jar!/schema

我使用一个Jar的maven插件将我的java打包到一个Jar中,其中包含所有依赖项

该项目有一个名为schema.xsd的资源

当我使用
java-jarmyjar.one jar运行jar文件时,我得到以下错误:

 org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document
 'jar:file:/../lib/myJar.one-jar.jar!/lib/myJar.jar!/schema.xsd', because 1) could not find 
the document; 2) the document could not be read; 3) the root element of the document is not 
<xsd:schema>.
org.xml.sax.SAXParseException:schema\u reference.4:读取架构文档失败
'jar:file:/../lib/myJar.one-jar.jar/lib/myJar.jar/schema.xsd',因为1)找不到
文件;2) 文件无法读取;3) 文档的根元素不是
.
知道为什么会这样吗


注意:应用程序有一个log4j.properties作为资源,并且可以识别它。

我非常确定jre中的Jar url连接处理实现不能处理多个嵌套级别(该url中有2个'!'字符)。不确定一个jar如何处理从嵌套jar中读取类文件的问题,但是您可能需要先将xsd提取到临时文件中,然后才能使用它


就我个人而言,我通常使用maven assembly插件来实现“jar with dependencies”的目标,除非一个或多个jar中有冲突的文件,否则它可以正常工作。

一个jar应该知道如何处理多个“!”人物。请参阅。@SummerBull-实际上,根据该链接,onejar似乎使用了一个自定义url方案,而不使用多个“!”查理看起来你是对的。但这只会让问题变得更加奇怪。