Skip to content

Commit fda5d1a

Browse files
Version Restriction Updates
- Adding rule for slf4j to exclude unstable versions by name (no alpha characters) - Adding rule preventing Mockito from updating to major version 4+ due to binding on Powermock version. - Adding notes for reusable regex references.
1 parent fe3dc34 commit fda5d1a

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

versionRuleset.xml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,51 @@
22
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 https://www.mojohaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
44
<rules>
5-
<!--
6-
xml-apis has a screwy version structure where the 2.x versions are older than the 1.x versions (check the dates in maven!).
7-
we are explicitly ignoring all of the 2.x version lineage of the project.
8-
-->
5+
<!--
6+
xml-apis has a screwy version structure where the 2.x versions are older than the 1.x versions (check the dates in maven!).
7+
we are explicitly ignoring all of the 2.x version lineage of the project.
8+
-->
99
<rule groupId="xml-apis" artifactId="xml-apis" comparisonMethod="maven">
1010
<ignoreVersions>
1111
<ignoreVersion type="regex">2.*</ignoreVersion>
1212
</ignoreVersions>
1313
</rule>
14+
<!--
15+
Mockito is bound to v.3.x until powermock gets updated
16+
Prevent auto-update of mockito based on that expectation
17+
18+
https://github.com/powermock/powermock/issues/1109
19+
-->
20+
<rule groupId="org.mockito" artifactId="mockito-core" comparisonMethod="maven">
21+
<ignoreVersions>
22+
<ignoreVersion type="regex">^0{0,1}[4-9].*</ignoreVersion>
23+
</ignoreVersions>
24+
</rule>
25+
<rule groupId="org.slf4j" artifactId="slf4j-api" comparisonMethod="maven">
26+
<ignoreVersions>
27+
<!-- Only stable versions -->
28+
<ignoreVersion type="regex">.*[a-zA-Z].*</ignoreVersion>
29+
</ignoreVersions>
30+
</rule>
1431
</rules>
1532
</ruleset>
33+
<!--
34+
###########################
35+
RE-USABLE REGEX REFERENCES
36+
###########################
37+
Keep in mind that regexes are used as exclusions:
38+
Anything that *DOES NOT MATCH IS VALID FOR UPDATE*
39+
40+
##### REGEX ##############
41+
.*[a-zA-Z].*
42+
###########################
43+
Some dependencies will only use {major}.{minor}.{patch} to identify STABLE versions
44+
This REGEX will exclude dependencies with any alpha characters.
45+
- Unstable references can be identified in maven central as those with a pink/red background
46+
47+
##### REGEX ##############
48+
^0{0,1}[4-9].*
49+
###########################
50+
Occassionally we need to couple to a major version of an artifact.
51+
This REGEX is an example of how to tie to the latest artifact of major versions 0,1,2,or 3
52+
-->

0 commit comments

Comments
 (0)