我试图更改我的xjb文件中的schemaLocation以使用不是使用URL的远程文件,而是使用也受版本控制的本地副本.
所以例如我的xjb文件有类似的东西
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsd:ID="JaxbBindingsForWMiddleware"
version="2.0">
schemaLocation="http://myserver:80/a/b/c/d/myxsd.xsd">
当我将其更改为本地副本时
schemaLocation="../../src/main/resources/myxsd.xsd">
mvn clean install将失败并显示类似的消息
[WARNING] Caused by: com.sun.istack.SAXParseException2;
systemId:
file:/E:/somefolder/somefolder/myjavaproject/target/bindings/myxjb.xjb;
lineNumber: 33; columnNumber: 33;
“file:/E:/somefolder/somefolder/myjavaproject/target/bindings/mywsdl.wsdl”
is not a part of this compilation. Is this a mistake for
“file:/E:/somefolder/somefolder/myjavaproject/target/bindings/myxjb.xjb”?
我注意到它正在目标目录中查找我的wsdl文件.我可以通过指向src目录的方式来操作schemaLocation.然后路径存在,但消息仍然存在.
我也可以将wsdl放在目标目录中,java尝试在其中找到它,但在这种情况下,消息保持不变.
所以看起来需要特定的东西来使它成为这个编译的一部分.应该怎么做才能以正确的方式编译它?