-
Notifications
You must be signed in to change notification settings - Fork 265
/
rule.mdo
230 lines (224 loc) · 7.46 KB
/
rule.mdo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xsd.namespace="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
xsd.targetNamespace="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0">
<id>rule</id>
<name>Rule</name>
<description>
A collection of version number comparison rules.
</description>
<defaults>
<default>
<key>package</key>
<value>org.codehaus.mojo.versions.model</value>
</default>
</defaults>
<versionDefinition>
<type>namespace</type>
</versionDefinition>
<classes>
<class xml.tagName="rule">
<name>Rule</name>
<description>
Describes a rule for how versions of artifacts should be handled.
</description>
<version>1.0+</version>
<fields>
<field>
<name>ignoreVersions</name>
<version>2.0+</version>
<required>false</required>
<type>List</type>
<description>Version patterns to ignore for this rule.</description>
<association>
<type>IgnoreVersion</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field xml.attribute="true">
<name>groupId</name>
<version>1.0+</version>
<required>true</required>
<type>String</type>
<description>
The for groupId to which this rule applies. Wildcards with ? and * are valid.
A rule applies to all child groupIds unless overridden by a subsequent rule.
A rule without wildcards will override a rule with wildcards.
A rule with ? wildcards will override a rule with * wildcards.
</description>
</field>
<field xml.attribute="true">
<name>artifactId</name>
<version>1.0+</version>
<required>false</required>
<type>String</type>
<description>
The artifactId to which this rule applies. Wildcards with ? and * are valid.
A rule without wildcards will override a rule with wildcards.
A rule with ? wildcards will override a rule with * wildcards.
</description>
</field>
<field xml.attribute="true">
<name>comparisonMethod</name>
<version>1.0+</version>
<required>true</required>
<type>String</type>
<description>The comparison method that this rule specifies.</description>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>1.0+</version>
<code><![CDATA[
/**
* Creates a new empty rule.
*/
public Rule()
{
// enables no-arg construction
artifactId = "*";
comparisonMethod = "maven";
}
]]></code>
</codeSegment>
<codeSegment>
<version>1.0+</version>
<code><![CDATA[
public String toString()
{
StringBuilder buf = new StringBuilder( 128 );
buf.append( "Rule[groupId = \"" );
buf.append( groupId );
buf.append( "\", artifactId = \"" );
buf.append( artifactId );
buf.append( "\", comparisonMethod = \"" );
buf.append( comparisonMethod );
buf.append( "\", ignoreVersions = \"" );
buf.append( ignoreVersions );
buf.append( "\"]" );
return buf.toString();
}
]]></code>
</codeSegment>
</codeSegments>
</class>
<class rootElement="true" xml.tagName="ruleset">
<name>RuleSet</name>
<description>
Describes a set of rules for how versions of artifacts should be handled.
</description>
<version>1.0+</version>
<fields>
<field>
<name>ignoreVersions</name>
<version>2.0+</version>
<required>false</required>
<type>List</type>
<description>Version patterns to ignore for all artifacts.</description>
<association>
<type>IgnoreVersion</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>rules</name>
<required>true</required>
<version>1.0+</version>
<association>
<type>Rule</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field xml.attribute="true">
<name>comparisonMethod</name>
<version>1.0+</version>
<required>true</required>
<type>String</type>
<description>The comparison method to use when no rule matches.</description>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>1.0+</version>
<code><![CDATA[
/**
* Creates a new empty rule set.
*/
public RuleSet()
{
// enables no-arg construction
comparisonMethod = "maven";
}
]]></code>
</codeSegment>
<codeSegment>
<version>1.0+</version>
<code><![CDATA[
public String toString()
{
StringBuilder buf = new StringBuilder( 128 );
buf.append( "RuleSet[rules = " );
buf.append( rules );
buf.append( ", comparisonMethod = \"" );
buf.append( comparisonMethod );
buf.append( "\"]" );
return buf.toString();
}
]]></code>
</codeSegment>
</codeSegments>
</class>
<class xsd.compositor="sequence">
<name>IgnoreVersion</name>
<version>2.0+</version>
<description>A version to ignore.</description>
<fields>
<field xml.content="true">
<name>version</name>
<version>2.0+</version>
<type>String</type>
<description>A version number or a regular expression for version numbers that should be ignored.
</description>
</field>
<field xml.attribute="true">
<name>type</name>
<version>2.0+</version>
<type>String</type>
<description>The type of ignore mechanism to use. Allowed values are 'exact' and 'regex'.</description>
<defaultValue>exact</defaultValue>
</field>
</fields>
<codeSegments>
<codeSegment>
<version>2.0+</version>
<code><![CDATA[public String toString()
{
StringBuilder buf = new StringBuilder( 128 );
buf.append( version );
buf.append( " (" );
buf.append( type );
buf.append( ")" );
return buf.toString();
}]]></code>
</codeSegment>
</codeSegments>
</class>
</classes>
</model>