Instead I just ran some tools on the settings-1.0.0.xsd file, to turn it into RelaxNG, and to turn it into RNC afterwards. This is what I produced from the XSD file. I forgot the tool I used, and I had to modify some of the content in order to get it working, but it sort of works:
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://maven.apache.org/SETTINGS/1.0.0" ns="http://maven.apache.org/SETTINGS/1.0.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<rng:start>
<rng:ref name="settings"/>
</rng:start>
<rng:define name="settings">
<rng:element name="settings">
<rng:ref name="Settings"/>
<a:documentation>
1.0.0
Root element of the user configuration file.
</a:documentation>
</rng:element>
</rng:define>
<rng:define name="Settings">
<a:documentation>
1.0.0
Root element of the user configuration file.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="localRepository">
<rng:data type="string">
<a:documentation>
1.0.0
The local repository.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : true</a:documentation>
<rng:element name="interactiveMode">
<rng:data type="boolean">
<a:documentation>
1.0.0
Whether Maven should attempt to interact with the user for input.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : false</a:documentation>
<rng:element name="usePluginRegistry">
<rng:data type="boolean">
<a:documentation>
1.0.0
Whether Maven should use the plugin-registry.xml file to manage plugin versions.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : false</a:documentation>
<rng:element name="offline">
<rng:data type="boolean">
<a:documentation>
1.0.0
Indicate whether maven should operate in offline mode full-time.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="proxies">
<a:documentation>
1.0.0
Configuration for different proxy profiles. Multiple proxy profiles
might come in handy for anyone working from a notebook or other
mobile platform, to enable easy switching of entire proxy
configurations by simply specifying the profile id, again either from
the command line or from the defaults section below.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="proxy">
<rng:ref name="Proxy"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="servers">
<a:documentation>
1.0.0
Configuration of server-specific settings, mainly authentication
method. This allows configuration of authentication on a per-server
basis.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="server">
<rng:ref name="Server"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="mirrors">
<a:documentation>
1.0.0
Configuration of download mirrors for repositories.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="mirror">
<rng:ref name="Mirror"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="profiles">
<a:documentation>
1.0.0
Configuration of build profiles for adjusting the build
according to environmental parameters.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="profile">
<rng:ref name="Profile"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="activeProfiles">
<a:documentation>
1.0.0
List of manually-activated build profiles, specified in the order in which
they should be applied.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="activeProfile">
<rng:data type="string"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="pluginGroups">
<a:documentation>
1.0.0
List of groupIds to search for a plugin when that plugin
groupId is not explicitly provided.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="pluginGroup">
<rng:data type="string"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Mirror">
<a:documentation>
1.0.0
A download mirror for a given repository.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="mirrorOf">
<rng:data type="string">
<a:documentation>
1.0.0
The server ID of the repository being mirrored, eg
"central". This MUST NOT match the mirror id.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="name">
<rng:data type="string">
<a:documentation>
1.0.0
The optional name that describes the mirror.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="url">
<rng:data type="string">
<a:documentation>
1.0.0
The URL of the mirror repository.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="id">
<rng:data type="string">
<a:documentation>
1.0.0
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Proxy">
<a:documentation>
1.0.0
The <code><proxy></code> element contains informations required to a proxy settings.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : false</a:documentation>
<rng:element name="active">
<rng:data type="boolean">
<a:documentation>
1.0.0
Whether this proxy configuration is the active one.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : http</a:documentation>
<rng:element name="protocol">
<rng:data type="string">
<a:documentation>
1.0.0
The proxy protocol.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="username">
<rng:data type="string">
<a:documentation>
1.0.0
The proxy user.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="password">
<rng:data type="string">
<a:documentation>
1.0.0
The proxy password.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : 8080</a:documentation>
<rng:element name="port">
<rng:data type="int">
<a:documentation>
1.0.0
The proxy port.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="host">
<rng:data type="string">
<a:documentation>
1.0.0
The proxy host.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="nonProxyHosts">
<rng:data type="string">
<a:documentation>
1.0.0
The list of non-proxied hosts (delimited by |).
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="id">
<rng:data type="string">
<a:documentation>
1.0.0
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Server">
<a:documentation>
1.0.0
The <code><server></code> element contains informations required to a server settings.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="username">
<rng:data type="string">
<a:documentation>
1.0.0
The username used to authenticate.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="password">
<rng:data type="string">
<a:documentation>
1.0.0
The password used in conjunction with the username to authenticate.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="privateKey">
<rng:data type="string">
<a:documentation>
1.0.0
The private key location used to authenticate.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="passphrase">
<rng:data type="string">
<a:documentation>
1.0.0
The passphrase used in conjunction with the privateKey to authenticate.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="filePermissions">
<rng:data type="string">
<a:documentation>
1.0.0
The permissions for files when they are created.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="directoryPermissions">
<rng:data type="string">
<a:documentation>
1.0.0
The permissions for directories when they are created.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="configuration">
<a:documentation>
0.0.0+
Extra configuration for the transport layer.
</a:documentation>
<rng:zeroOrMore>
<rng:element>
<rng:anyName/>
<rng:text/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="id">
<rng:data type="string">
<a:documentation>
1.0.0
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Profile">
<a:documentation>
1.0.0
Modifications to the build process which is keyed on some
sort of environmental parameter.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="activation">
<rng:ref name="Activation"/>
<a:documentation>
1.0.0
The conditional logic which will automatically
trigger the inclusion of this profile.
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="properties">
<a:documentation>
0.0.0+
Extended configuration specific to this profile goes here.
Contents take the form of
<property.name>property.value</property.name>
</a:documentation>
<rng:zeroOrMore>
<rng:element>
<rng:anyName/>
<rng:text/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="repositories">
<a:documentation>
1.0.0
The lists of the remote repositories.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="repository">
<rng:ref name="Repository"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="pluginRepositories">
<a:documentation>
1.0.0
The lists of the remote repositories for discovering plugins.
</a:documentation>
<rng:zeroOrMore>
<rng:element name="pluginRepository">
<rng:ref name="Repository"/>
</rng:element>
</rng:zeroOrMore>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="id">
<rng:data type="string">
<a:documentation>
1.0.0
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Repository">
<a:documentation>
1.0.0
Repository contains the information needed for establishing
connections with remote repoistory
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="releases">
<rng:ref name="RepositoryPolicy"/>
<a:documentation>
1.0.0
How to handle downloading of releases from this repository
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="snapshots">
<rng:ref name="RepositoryPolicy"/>
<a:documentation>
1.0.0
How to handle downloading of snapshots from this repository
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="id">
<rng:data type="string">
<a:documentation>
1.0.0
A unique identifier for a repository.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="name">
<rng:data type="string">
<a:documentation>
1.0.0
Human readable name of the repository.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="url">
<rng:data type="string">
<a:documentation>
1.0.0
The url of the repository.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : default</a:documentation>
<rng:element name="layout">
<rng:data type="string">
<a:documentation>
1.0.0
The type of layout this repository uses for locating and
storing artifacts - can be "legacy" or "default".
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="RepositoryPolicy">
<a:documentation>
1.0.0
Download policy
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : true</a:documentation>
<rng:element name="enabled">
<rng:data type="boolean">
<a:documentation>
1.0.0
Whether to use this repository for downloading this type of
artifact.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="updatePolicy">
<rng:data type="string">
<a:documentation>
1.0.0
The frequency for downloading updates - can be "always",
"daily" (default), "interval:XXX" (in minutes) or "never"
(only if it doesn't exist locally).
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="checksumPolicy">
<rng:data type="string">
<a:documentation>
1.0.0
What to do when verification of an artifact checksum fails -
warn, fail, etc. Valid values are "fail" or "warn".
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="Activation">
<a:documentation>
1.0.0
The conditions within the build runtime environment which will trigger
the automatic inclusion of the parent build profile.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<a:documentation>
default value is : false</a:documentation>
<rng:element name="activeByDefault">
<rng:data type="boolean">
<a:documentation>
1.0.0
Flag specifying whether this profile is active as a default.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="jdk">
<rng:data type="string">
<a:documentation>
1.0.0
Specifies that this profile will be activated when a matching JDK is detected.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="os">
<rng:ref name="ActivationOS"/>
<a:documentation>
1.0.0
Specifies that this profile will be activated when matching OS attributes are detected.
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="property">
<rng:ref name="ActivationProperty"/>
<a:documentation>
1.0.0
Specifies that this profile will be activated when this System property is specified.
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="file">
<rng:ref name="ActivationFile"/>
<a:documentation>
1.0.0
Specifies that this profile will be activated based on existence of a file.
</a:documentation>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="ActivationFile">
<a:documentation>
1.0.0
This is the file specification used to activate a profile. The missing value will be a the location
of a file that needs to exist, and if it doesn't the profile must run. On the other hand exists will test
for the existence of the file and if it is there will run the profile.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="missing">
<rng:data type="string">
<a:documentation>
1.0.0
The name of the file that should be missing to activate a
profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="exists">
<rng:data type="string">
<a:documentation>
1.0.0
The name of the file that should exist to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="ActivationOS">
<a:documentation>
1.0.0
This is an activator which will detect an operating system's attributes in order to activate
its profile.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="name">
<rng:data type="string">
<a:documentation>
1.0.0
The name of the OS to be used to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="family">
<rng:data type="string">
<a:documentation>
1.0.0
The general family of the OS to be used to activate a
profile (e.g. 'windows')
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="arch">
<rng:data type="string">
<a:documentation>
1.0.0
The architecture of the OS to be used to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="version">
<rng:data type="string">
<a:documentation>
1.0.0
The version of the OS to be used to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
<rng:define name="ActivationProperty">
<a:documentation>
1.0.0
This is the property specification used to activate a profile. If the value field is empty,
then the existence of the named property will activate the profile, otherwise it does a case-sensitive
match against the property value as well.
</a:documentation>
<rng:interleave>
<rng:optional>
<rng:optional>
<rng:element name="name">
<rng:data type="string">
<a:documentation>
1.0.0
The name of the property to be used to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
<rng:optional>
<rng:optional>
<rng:element name="value">
<rng:data type="string">
<a:documentation>
1.0.0
The value of the property to be used to activate a profile.
</a:documentation>
</rng:data>
</rng:element>
</rng:optional>
</rng:optional>
</rng:interleave>
</rng:define>
</rng:grammar>
0 comments:
Post a Comment