Skip to content

Commit f8c1a73

Browse files
committed
Prevent import of Micrometer class outside of the Actuator
Closes gh-25760
1 parent 2b29b99 commit f8c1a73

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/checkstyle/import-control.xml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE import-control PUBLIC "-//Checkstyle//DTD ImportControl Configuration 1.4//EN" "https://checkstyle.org/dtds/import_control_1_4.dtd">
33
<import-control pkg="org.springframework.boot">
4+
<disallow pkg="io.micrometer" />
45
<allow pkg=".*" regex="true" />
5-
66
<subpackage name="autoconfigure">
77
<subpackage name="web">
88
<allow pkg="org.springframework.boot.web.server" />
@@ -38,22 +38,29 @@
3838
</subpackage>
3939
</subpackage>
4040

41-
<!-- Endpoint infrastructure -->
42-
<subpackage name="actuate.endpoint">
43-
<disallow pkg="org.springframework.http" />
44-
<disallow pkg="org.springframework.web" />
45-
<subpackage name="web">
46-
<allow pkg="org.springframework.http" />
47-
<allow pkg="org.springframework.web" />
48-
<subpackage name="servlet">
49-
<disallow pkg="org.springframework.web.reactive" />
50-
</subpackage>
51-
<subpackage name="reactive">
52-
<disallow pkg="org.springframework.web.servlet" />
41+
<subpackage name="actuate">
42+
<allow pkg="io.micrometer" />
43+
<!-- Endpoint infrastructure -->
44+
<subpackage name="endpoint">
45+
<disallow pkg="org.springframework.http" />
46+
<disallow pkg="org.springframework.web" />
47+
<subpackage name="web">
48+
<allow pkg="org.springframework.http" />
49+
<allow pkg="org.springframework.web" />
50+
<subpackage name="servlet">
51+
<disallow pkg="org.springframework.web.reactive" />
52+
</subpackage>
53+
<subpackage name="reactive">
54+
<disallow pkg="org.springframework.web.servlet" />
55+
</subpackage>
5356
</subpackage>
5457
</subpackage>
5558
</subpackage>
5659

60+
<subpackage name="docs.actuate">
61+
<allow pkg="io.micrometer" />
62+
</subpackage>
63+
5764
<!-- Logging -->
5865
<subpackage name="logging">
5966
<disallow pkg="org.springframework.context" />

0 commit comments

Comments
 (0)