Links / including xsd files in the bank

I want to add an xsd file to our project, which relies on types defined in another xsd, which is in the bank. We use jaxb to generate Java classes from xsds. How can I refer to SchemaContainingFooTypeIsInaJAR.xsd so that "FooType" resolves correctly and the corresponding Java classes are generated

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="SchemaContainingFooTypeIsInaJAR.xsd"/>
<xs:complexType name="FooMoreType">
    <xs:complexContent>
        <xs:extension base="FooType">
            <xs:sequence>
                <xs:element name="something" type="xs:boolean" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            something something
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>
</xs:schema>
+5
source share
3 answers

You may be interested in the following functions:

In short, you can write a directory file that points to your schema in a JAR file:

REWRITE_SYSTEM "some/url/a.xsd" "maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a!/a.xsd"

: maven-jaxb2-plugin.

+2

Replace your line:

<xs:include schemaLocation="SchemaContainingFooTypeIsInaJAR.xsd"/>

with

<xs:include schemaLocation="jar:file:///path/to/jar/thing.jar!/path/inside/jar/to/file.xsd"/>

0
source

All Articles