Вопрос

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