Skip to content

Commit 253dbed

Browse files
committed
Add checkstyle import control check
1 parent 61211bc commit 253dbed

File tree

6 files changed

+160
-1
lines changed

6 files changed

+160
-1
lines changed

build-tools/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<artifactId>flowable-build-tools</artifactId>
7+
8+
<parent>
9+
<groupId>org.flowable</groupId>
10+
<artifactId>flowable-root</artifactId>
11+
<version>8.0.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<properties>
15+
<maven.deploy.skip>true</maven.deploy.skip>
16+
<checkstyle.skip>true</checkstyle.skip>
17+
</properties>
18+
19+
20+
</project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE module PUBLIC
4+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
5+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
6+
7+
<!-- Based on sun_checks.xml from the CheckStyle distribution -->
8+
9+
<module name="Checker">
10+
<!--
11+
If you set the basedir property below, then all reported file
12+
names will be relative to the specified directory. See
13+
https://checkstyle.sourceforge.io/config.html
14+
15+
<property name="basedir" value="${basedir}"/>
16+
-->
17+
18+
<property name="cacheFile" value="${checkstyle.cache.file}"/>
19+
20+
<module name="SuppressWithPlainTextCommentFilter"/>
21+
22+
<module name="TreeWalker">
23+
24+
<module name="SuppressWarningsHolder"/>
25+
26+
<!-- Checks for imports -->
27+
<!-- See https://checkstyle.sourceforge.io/checks/imports/index.html -->
28+
<module name="AvoidStarImport"/>
29+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
30+
<!--<module name="RedundantImport"/>-->
31+
<!--<module name="UnusedImports">-->
32+
<!-- <property name="processJavadoc" value="true"/>-->
33+
<!--</module>-->
34+
<module name="ImportControl">
35+
<property name="file" value="/build-config/import-control.xml" />
36+
</module>
37+
38+
39+
<!-- Checks for class design -->
40+
<!-- See https://checkstyle.sourceforge.io/checks/design/index.html -->
41+
<!-- <module name="VisibilityModifier">-->
42+
<!-- <property name="packageAllowed" value="true" />-->
43+
<!-- <property name="protectedAllowed" value="true" />-->
44+
<!-- </module>-->
45+
46+
<module name="SuppressionCommentFilter"/>
47+
</module>
48+
49+
<module name="SuppressWarningsFilter"/>
50+
51+
</module>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE import-control PUBLIC
3+
"-//Puppy Crawl//DTD Import Control 1.4//EN"
4+
"http://www.puppycrawl.com/dtds/import_control_1_4.dtd">
5+
<import-control pkg="org">
6+
7+
<subpackage name="flowable">
8+
<allow pkg="com.fasterxml.jackson.annotation"/>
9+
<allow pkg="com.fasterxml.uuid"/>
10+
<disallow pkg="com.fasterxml"/>
11+
<disallow pkg="org.activiti"/>
12+
13+
<allow pkg=".*" regex="true"/>
14+
15+
<file name=".*Jackson2.*" regex="true">
16+
<allow pkg="com.fasterxml.jackson.databind"/>
17+
<allow pkg="com.fasterxml.jackson.core"/>
18+
</file>
19+
20+
<subpackage name="common.engine.impl.json.jackson2">
21+
<allow pkg="com.fasterxml.jackson.databind"/>
22+
<allow pkg="com.fasterxml.jackson.core"/>
23+
</subpackage>
24+
25+
<subpackage name="compatibility">
26+
<allow pkg="org.activiti" />
27+
</subpackage>
28+
</subpackage>
29+
30+
<subpackage name="activiti">
31+
32+
<allow pkg="com.fasterxml.jackson.annotation"/>
33+
<allow pkg="com.fasterxml.uuid"/>
34+
<disallow pkg="com.fasterxml"/>
35+
36+
<allow pkg=".*" regex="true"/>
37+
38+
</subpackage>
39+
40+
</import-control>

modules/flowable-parent/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,19 @@
158158
</execution>
159159
</executions>
160160
</plugin>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-checkstyle-plugin</artifactId>
164+
<executions>
165+
<execution>
166+
<id>check-style</id>
167+
<phase>verify</phase>
168+
<goals>
169+
<goal>check</goal>
170+
</goals>
171+
</execution>
172+
</executions>
173+
</plugin>
161174
</plugins>
162175
</build>
163176

modules/flowable-spring-boot/flowable-spring-boot-samples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<properties>
1616
<maven.deploy.skip>true</maven.deploy.skip>
1717
<skip.test.db.drop>false</skip.test.db.drop>
18+
<checkstyle.skip>true</checkstyle.skip>
1819
</properties>
1920

2021
<packaging>pom</packaging>

pom.xml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
<modules>
3737
<module>modules/flowable-bom</module>
38+
<module>build-tools</module>
3839
<module>modules/flowable-parent</module>
3940
<module>modules/flowable-dependencies</module>
4041
<module>modules/flowable-bpmn-model</module>
@@ -170,7 +171,33 @@
170171
<version>${central-publishing-maven-plugin.version}</version>
171172
<extensions>true</extensions>
172173
</plugin>
173-
</plugins>
174+
<plugin>
175+
<groupId>org.apache.maven.plugins</groupId>
176+
<artifactId>maven-checkstyle-plugin</artifactId>
177+
<version>3.6.0</version>
178+
<configuration>
179+
<configLocation>build-config/checkstyle.xml</configLocation>
180+
<consoleOutput>true</consoleOutput>
181+
<failsOnError>true</failsOnError>
182+
<violationSeverity>error</violationSeverity>
183+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
184+
<propertyExpansion>basedir=${basedir}</propertyExpansion>
185+
</configuration>
186+
<dependencies>
187+
<dependency>
188+
<groupId>com.puppycrawl.tools</groupId>
189+
<artifactId>checkstyle</artifactId>
190+
<version>12.1.2</version>
191+
</dependency>
192+
<dependency>
193+
<groupId>org.flowable</groupId>
194+
<artifactId>flowable-build-tools</artifactId>
195+
<version>${project.version}</version>
196+
</dependency>
197+
</dependencies>
198+
</plugin>
199+
200+
</plugins>
174201
</pluginManagement>
175202
</build>
176203

@@ -367,6 +394,13 @@
367394
<module>modules/flowable5-test</module>
368395
</modules>
369396
</profile>
397+
<profile>
398+
<id>quick</id>
399+
<properties>
400+
<checkstyle.skip>true</checkstyle.skip>
401+
<skipTests>true</skipTests>
402+
</properties>
403+
</profile>
370404
</profiles>
371405

372406
<!-- Various information, not used by the build -->

0 commit comments

Comments
 (0)