I have the following xsd schema definition

<xs:schema targetNamespace="foo"
           elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:reference="reference.bar"
    >

 <xs:import namespace="reference.bar" schemaLocation="bar.xsd"/>

 <xs:element name="Foo" type="Foo"/>
 <xs:complexType name="Foo">
        <xs:sequence>
               <xs:element name="Id" type="xs:long" />
               <xs:element name="items" type="reference:Items" />
        </xs:sequence>
 </xs:complexType>

</xs:schema>

when I do gradle generateSources task I get next error: [ERROR] src-resolve: Cannot resolve the name 'reference:Items' to a(n) 'type definition' component

This schema definition and bar.xsd are located in the same folders. Why I get this error?

有帮助吗?

解决方案

The problem was with path where proejct is located. Seems jaxb when generating sources takes absolute path to xsd files. My path contained special symbols such as [ and ]

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top