문제

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