<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright The JBoss Metadata Authors
  SPDX-License-Identifier: Apache-2.0
-->
<xs:schema xmlns="urn:jboss:jakartaee:1.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jakartaee="https://jakarta.ee/xml/ns/jakartaee"
           xmlns:jboss="urn:jboss:jakartaee:1.0"
           targetNamespace="urn:jboss:jakartaee:1.0"
           version="11"
           elementFormDefault="qualified">

    <xs:annotation>
        <xs:documentation>
            <![CDATA[

    This is the XML Schema for the JBoss EAR application deployment descriptor.
    The deployment descriptor must be named "jboss-app.xml" and placed in the
    .ear/META-INF folder. All the descriptors must indicate
    the JBoss schema by using the Jakarta EE namespace:

        urn:jboss:jakartaee:1.0

    and by indicating the version of the schema by
    using the version attribute as shown below:

        <jboss-app xmlns="urn:jboss:jakartaee:1.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             version="11">
             ...
        </jboss-app>

    The instance documents may indicate the published version of
    the schema using the xsi:schemaLocation attribute for the
    Jakarta EE namespace with the following location:

        https://www.jboss.org/schema/jbossas/jboss-app_11_0.xsd

    ]]>
        </xs:documentation>
    </xs:annotation>

    <!-- Import the JakartaEE 11 xsd -->
    <xs:import namespace="https://jakarta.ee/xml/ns/jakartaee"
               schemaLocation="https://jakarta.ee/xml/ns/jakartaee/application_11.xsd"/>



    <!-- Include the common JBoss EE elements -->
    <xs:include schemaLocation="https://www.jboss.org/schema/jbossas/jboss-common_11_0.xsd"/>


    <xs:element name="jboss-app" type="jboss-appType"/>

    <xs:complexType name="jboss-appType">
        <xs:annotation>
            <xs:documentation>
                Root element for JBoss specific configurations in a .ear
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="jakartaee:applicationType">
                <xs:sequence>
                    <xs:element name="distinct-name" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>
                                The distinct-name for this application.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="security-domain" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>
                                The security domain application for this application.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="unauthenticated-principal" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>
                                The principal that will be used for unauthenticated requests in this application
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>

                    <xs:element name="library-directory" type="xs:string" minOccurs="0" maxOccurs="1"/>

                    <xs:element name="security-role" minOccurs="0" maxOccurs="unbounded"
                                type="jboss:security-roleType"/>

                    <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="moduleType"/>

                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="moduleType">
        <xs:complexContent>
            <xs:extension base="jakartaee:moduleType">
                <xs:sequence>
                    <xs:element name="service" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="har" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="web" type="jakartaee:webType" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

</xs:schema>
