質問

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