jbonofre commented on code in PR #951:
URL: https://github.com/apache/aries/pull/951#discussion_r4619648812
##########
tutorials/blueprint/tutorial-assembly/src/main/filtered-resources/configuration/config.ini:
##########
@@ -29,7 +29,7 @@
org.apache.aries.util-${org.apache.aries.util.version}.jar@start,\
org.apache.aries.proxy-${org.apache.aries.proxy.version}.jar@start,\
org.apache.aries.quiesce.api-${org.apache.aries.quiesce.api.version}.jar@start,\
org.apache.aries.quiesce.manager-${org.apache.aries.quiesce.manager.version}.jar@start,\
-org.apache.aries.blueprint.api-${org.apache.aries.blueprint.api.version}.jar@start,\
+org.osgi-${org.osgi.service.blueprint.version}.jar@start,\
Review Comment:
The assembly uses the default file name mapping (`artifactId-version.jar`),
so this bundle ends up in `/platform` as
`org.osgi.service.blueprint-1.0.2.jar`. As written, Equinox won't find
`org.osgi-1.0.2.jar`, and blueprint-core can't resolve its
`org.osgi.service.blueprint.*` imports.
```suggestion
org.osgi.service.blueprint-${org.osgi.service.blueprint.version}.jar@start,\
```
##########
blueprint/blueprint-core/pom.xml:
##########
@@ -255,6 +230,8 @@
<excludes>
<exclude>method
org.apache.aries.blueprint.di.Repository getRepository() has been
deleted</exclude>
<exclude>class
org/apache/aries/blueprint/ext/PropertyPlaceholder was not abstract but is
changed to be abstract</exclude>
+ <exclude>In the package org.osgi.service.blueprint,
The schema file has been updated: blueprint.xsd.</exclude>
+ <exclude>In the package org.apache.aries.blueprint,
The schema file has been updated: blueprint.xsd.</exclude>
Review Comment:
These two excludes are only needed because the xsd content changed (see the
comment on `blueprint.xsd`). If the existing schema is moved over unchanged,
they can go.
If they stay, they hide more than this one change. In `BundleCompatibility`,
once the xsd update is recorded as a major change for a package, the remaining
xsds aren't compared and `checkAdditionalClassOrXsds` is skipped. The exclude
then turns the result into NO_CHANGE. So until the baseline moves past 1.10.3,
new or changed classes and xsds in `org.osgi.service.blueprint` or
`org.apache.aries.blueprint` won't be reported. Also,
`org.osgi.service.blueprint;version=1.0.0` keeps its version even though its
schema changed.
##########
blueprint/blueprint-bundle/pom.xml:
##########
@@ -248,6 +248,8 @@
<excludes>
<exclude>method
org.apache.aries.blueprint.di.Repository getRepository() has been
deleted</exclude>
<exclude>class
org/apache/aries/blueprint/ext/PropertyPlaceholder was not abstract but is
changed to be abstract</exclude>
+ <exclude>In the package org.osgi.service.blueprint,
The schema file has been updated: blueprint.xsd.</exclude>
+ <exclude>In the package org.apache.aries.blueprint,
The schema file has been updated: blueprint.xsd.</exclude>
Review Comment:
Same as in blueprint-core/pom.xml: these go away if the xsd is moved over
unchanged.
##########
blueprint/blueprint-core/src/main/resources/org/osgi/service/blueprint/blueprint.xsd:
##########
@@ -0,0 +1,1233 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ /*
+ * $Id: 2b09558a5a4a6cf1633def5e13fb5737c30a1a8f $
+ *
+ * Copyright (c) OSGi Alliance (2008, 2013). All Rights Reserved.
+ *
+ * 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.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ version="1.0.1">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ This is the XML Schema for the OSGi Blueprint service 1.0.0
+ development descriptor. Blueprint configuration files
+ using this schema must indicate the schema using the
+ blueprint/v1.0.0 namespace. For example,
+
+ <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ if used as a qualified namespace, "bp" is the recommended
+ namespace prefix.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <!-- Schema elements for core component declarations -->
+
+ <xsd:complexType name="Tcomponent" abstract="true">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The Tcomponent type is the base type for top-level
+ Blueprint components. The <bean> <reference>, <service>,
+ and <reference-list> elements are all derived from
+ the Tcomponent type. This type defines an id attribute
+ that is used create references between different
components.
+ Component elements can also be inlined within other
component
+ definitions. The id attribute is not valid when inlined.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:attribute name="id" type="xsd:ID" />
+
+ <xsd:attribute name="activation" type="Tactivation">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The activation attribute for this component. This can
either
+ be "eager" or "lazy". If not specified, it
+ defaults to default-activation attribute of the enclosing
+ <blueprint> element.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+
+ <xsd:attribute name="depends-on" type="TdependsOn">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ depends-on identifies (by id) other components that this
component
+ depends on. The component only be activated after the
+ depends-on components are successfully activated. Also,
if there
+ are <reference> or <reference-list> elements with
unstatisfied
+ manadatory references, then the depends-on relationship
will also
+ be used to determine whether this service is enabled or
not.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <xsd:element name="blueprint" type="Tblueprint">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The <blueprint> element is the root element for a blueprint
+ configuration file. A blueprint configuration has two
sections.
+ The first section (contained within the <type-converters>
element)
+ identifies components that are used for converting values into
+ different target types. The type converters are optional, so
+ the file does not need to specify a type converter section.
+
+ Following the type converters are the component definitions.
+ Components are <bean>, <service>, <reference>, and
+ <reference-list> elements that identify the bundle components
that will
+ be managed by the blueprint service.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:complexType name="Tblueprint">
+ <xsd:sequence>
+ <xsd:element name="description" type="Tdescription"
+ minOccurs="0" />
+ <xsd:element name="type-converters" type="Ttype-converters"
+ minOccurs="0" maxOccurs="1" />
+ <!-- top-level components -->
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="service" type="Tservice" />
+ <xsd:element name="reference-list" type="Treference-list" />
+ <xsd:element name="bean" type="Tbean" />
+ <xsd:element name="reference" type="Treference" />
+ <xsd:any namespace="##other" processContents="lax" />
Review Comment:
This isn't the schema blueprint-api shipped. It's the OSGi 1.0.1 schema.
Apart from whitespace and the header, the only difference is that all 17
`<xsd:any namespace="##other" processContents="strict"/>` wildcards are now
`lax` (plus `version="1.0.1"`).
That changes runtime validation in blueprint-core, blueprint-bundle and
blueprint-noosgi. An element in a custom namespace with no declaration in a
loaded schema used to be rejected at parse time (`cvc-complex-type.2.4.c: The
matching wildcard is strict, but no declaration can be found...`). Now it
passes validation, and catching it is left to the namespace handler. A typo
like `<ext:property-placeholderr>` is the simplest example.
Could we `git mv` the existing
`blueprint/blueprint-api/src/main/resources/org/osgi/service/blueprint/blueprint.xsd`
here instead? That keeps validation unchanged and should make the new
versioning excludes unnecessary. If switching to the lax schema is wanted, I'd
rather do it in its own JIRA, with a package version bump.
The same applies to `org/apache/aries/blueprint/blueprint.xsd`, which is
byte-identical to this file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]