I am trying to modify the schemaLocation in my xjb file so that I do not use the remote file using the URL, but use a local copy, which is also under version control.
So, for example, my xjb file has something similar to
<?xml version="1.0" encoding="UTF-8"?> <jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsd:ID="JaxbBindingsForWMiddleware" version="2.0"> <jxb:bindings node="/xsd:schema" schemaLocation="http://myserver:80/a/b/c/d/myxsd.xsd">
When I change this to a local copy, for example
schemaLocation="../../src/main/resources/myxsd.xsd">
mvn clean install will complete with a message similar to
[WARNING] Called: 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 part of this compilation. Is this a bug for "File: / E: /somefolder/somefolder/myjavaproject/target/bindings/myxjb.xjb"?
I noticed that it is looking for my wsdl file in the target directory. I can manipulate schemaLocation so that it points to the src directory. Then the path exists, but the message remains.
I can also put wsdl in the target directory where java tries to find it, but in this case the message remains unchanged.
So, it seems like something specific is about to happen in order to make it part of this compilation. What needs to be done to compile it correctly?
source share