Skip to content

Commit

Permalink
Merge pull request #158 from ehsavoie/JBMETA-439
Browse files Browse the repository at this point in the history
[JBMETA-439]: Jboss application schema is not jakartaee 10 compatible.
  • Loading branch information
ehsavoie authored Sep 14, 2022
2 parents 754b4c9 + 8721af7 commit 4018315
Show file tree
Hide file tree
Showing 6 changed files with 448 additions and 2 deletions.
79 changes: 79 additions & 0 deletions appclient/src/main/resources/schema/jboss-client_9_0.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source
~ Copyright 2019, Red Hat, Inc., and individual contributors as indicated
~ by the @authors tag.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jboss="https://www.jboss.com/xml/ns/jakartaee"
targetNamespace="https://www.jboss.com/xml/ns/jakartaee"
version="9.0"
elementFormDefault="qualified"
>

<xsd:annotation>
<xsd:documentation>
<![CDATA[
This is the XML Schema for the JBoss 8.0 application client deployment descriptor.
The deployment descriptor must be named "META-INF/jboss-client.xml" in
the application client's jar file. All the application client deployment descriptors must indicate
the JBoss schema by using the Java EE namespace:
https://www.jboss.com/xml/ns/jakartaee
and by indicating the version of the schema by
using the version attribute as shown below:
<jboss-client xmlns="https://www.jboss.com/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.jboss.com/xml/ns/jakartaee
https://www.jboss.org/j2ee/schema/jboss-client_9_0.xsd"
version="8.1">
...
</jboss-client>
The instance documents may indicate the published version of
the schema using the xsi:schemaLocation attribute for the
Java EE namespace with the following location:
https://www.jboss.org/j2ee/schema/jboss-client_9_0.xsd
]]>
</xsd:documentation>
</xsd:annotation>

<xsd:import namespace="https://jakarta.ee/xml/ns/jakartaee" schemaLocation="https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd"/>
<xsd:include schemaLocation="https://www.jboss.org/schema/jbossas/jboss-common_9_0.xsd"/>

<xsd:element name="jboss-client" type="jboss:jboss-clientType"/>

<xsd:complexType name="jboss-clientType">
<xsd:sequence>
<xsd:element name="module-name" type="xsd:string" minOccurs="0"/>
<xsd:group ref="jboss:descriptionGroup"/>
<xsd:element name="callback-handler" type="xsd:string" minOccurs="0"/>
<xsd:element name="metadata-complete" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="jndi-name" type="xsd:string" minOccurs="0"/>
<xsd:group ref="jboss:jndiEnvironmentRefsGroup"/>
<xsd:element name="message-destinations" type="jboss:message-destinationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="depends" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="version" type="xsd:string"/>
</xsd:complexType>

</xsd:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AppclientSpecDescriptorTestCase extends SpecDescriptorTestCase {
@Parameters
public static List<Object[]> parameters() {
// The spec descriptor should be guarded in schema
return Arrays.asList(new Object[][]{{"schema/application-client_6.xsd"},{"schema/application-client_7.xsd"},{"schema/application-client_8.xsd"}});
return Arrays.asList(new Object[][]{{"schema/application-client_6.xsd"},{"schema/application-client_7.xsd"},{"schema/application-client_8.xsd"},{"schema/application-client_9.xsd"}});
}

public AppclientSpecDescriptorTestCase(String xsd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class JBossAppMetaData extends EarMetaData {
private String distinctName;

public JBossAppMetaData() {
super(EarVersion.APP_8_0);
super(EarVersion.APP_10_0);
}

public JBossAppMetaData(EarVersion earVersion) {
Expand Down
122 changes: 122 additions & 0 deletions ear/src/main/resources/schema/jboss-app_9_0.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source
~ Copyright 2019, Red Hat, Inc., and individual contributors as indicated
~ by the @authors tag.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<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="http://www.jboss.com/xml/ns/jakartaee"
targetNamespace="http://www.jboss.com/xml/ns/jakartaee"
version="9.0"
elementFormDefault="qualified">

<xs:annotation>
<xs:documentation>
<![CDATA[
This is the XML Schema for the JBoss AS7 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 Java 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="http://www.jboss.com/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="8.1">
...
</jboss-app>
The instance documents may indicate the published version of
the schema using the xsi:schemaLocation attribute for the
Java EE namespace with the following location:
https://www.jboss.org/schema/jbossas/jboss-app_10_0.xsd
]]>
</xs:documentation>
</xs:annotation>

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

<!-- Include the common JBoss EE elements -->
<xs:include schemaLocation="https://www.jboss.org/schema/jbossas/jboss-common_9_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>
Loading

0 comments on commit 4018315

Please sign in to comment.