Skip to content

Commit f6614ef

Browse files
committed
Introduce spotless and error-prone into the build including the related code reformatting
1 parent 8606249 commit f6614ef

File tree

7 files changed

+464
-277
lines changed

7 files changed

+464
-277
lines changed

.mvn/jvm.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
2+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
3+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
4+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
5+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
6+
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
8+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
10+
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,16 @@ bin/hdfs groups
8787
```
8888

8989
The last command will yield something like this:
90+
9091
```shell
9192
nn/simple-hdfs.default.svc.cluster.local@CLUSTER.LOCAL : admin superuser
9293
```
94+
9395
and the Hadoop logs will show that the lookup has taken place:
9496

9597
```
9698
- Calling StackableGroupMapper.getGroups for user [nn]
9799
- Opa response [{"result":{"groups":{"groups":["/admin","/superuser"]},"users_by_name":{"alice":{"customAttributes":{},"groups":["/superset-admin"],"id":"af07f12c-1234-40a7-93e0-874537bdf3f5","username":"alice"},"bob":{"customAttributes":{},"groups":["/admin"],"id":"af07f12c-2345-40a7-93e0-874537bdf3f5","username":"bob"},"nn":{"customAttributes":{},"groups":["/admin","/superuser"],"id":"af07f12c-7890-40a7-93e0-874537bdf3f5","username":"nn"},"stackable":{"customAttributes":{},"groups":["/admin","/superuser"],"id":"af07f12c-3456-40a7-93e0-874537bdf3f5","username":"stackable"}}}}
98100
- Groups for [nn]: [[admin, superuser]]
99-
```
101+
```
102+

pom.xml

Lines changed: 229 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,234 @@
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-
<modelVersion>4.0.0</modelVersion>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
44

5-
<groupId>tech.stackable</groupId>
6-
<artifactId>hdfs-group-mapper</artifactId>
7-
<version>0.1.0-SNAPSHOT</version>
8-
<packaging>jar</packaging>
5+
<groupId>tech.stackable</groupId>
6+
<artifactId>hdfs-group-mapper</artifactId>
7+
<version>0.1.0-SNAPSHOT</version>
98

10-
<name>hdfs-group-mapper</name>
11-
<url>http://maven.apache.org</url>
9+
<name>Apache Hadoop HDFS OpenPolicyAgent Group Mapper</name>
10+
<url>https://github.com/stackabletech/hdfs-group-mapper/</url>
11+
<organization>
12+
<name>Stackable GmbH</name>
13+
<url>https://stackable.tech</url>
14+
</organization>
15+
<licenses>
16+
<license>
17+
<name>Apache-2.0</name>
18+
</license>
19+
</licenses>
20+
<scm>
21+
<connection>scm:git:${project.scm.url}</connection>
22+
<developerConnection>scm:git:${project.scm.url}</developerConnection>
23+
<tag>HEAD</tag>
24+
<url>git@github.com:stackabletech/hdfs-group-mapper.git</url>
25+
</scm>
26+
<issueManagement>
27+
<system>GitHub</system>
28+
<url>https://github.com/stackabletech/hdfs-group-mapper/issues</url>
29+
</issueManagement>
1230

13-
<properties>
14-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<hadoop.version>3.3.6</hadoop.version>
16-
<maven.compiler.source>11</maven.compiler.source>
17-
<maven.compiler.target>11</maven.compiler.target>
18-
</properties>
31+
<properties>
32+
<java.version>11</java.version>
33+
<maven.compiler.source>${java.version}</maven.compiler.source>
34+
<maven.compiler.target>${java.version}</maven.compiler.target>
35+
<maven.compiler.release>${java.version}</maven.compiler.release>
36+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
37+
38+
<cleanthat.version>2.17</cleanthat.version>
39+
<error-prone.version>2.24.1</error-prone.version>
40+
41+
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
42+
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
43+
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
44+
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
45+
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
46+
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
47+
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
48+
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
49+
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
50+
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
51+
52+
<hadoop.version>3.3.6</hadoop.version>
53+
</properties>
54+
55+
<dependencies>
56+
<dependency>
57+
<groupId>org.apache.hadoop</groupId>
58+
<artifactId>hadoop-common</artifactId>
59+
<version>${hadoop.version}</version>
60+
<scope>provided</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.slf4j</groupId>
64+
<artifactId>slf4j-api</artifactId>
65+
<version>1.7.36</version>
66+
<scope>provided</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>com.fasterxml.jackson.core</groupId>
70+
<artifactId>jackson-databind</artifactId>
71+
<version>2.12.7.1</version>
72+
<scope>provided</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>junit</groupId>
76+
<artifactId>junit</artifactId>
77+
<version>4.13.1</version>
78+
<scope>test</scope>
79+
</dependency>
80+
</dependencies>
81+
82+
<build>
83+
<plugins>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-clean-plugin</artifactId>
87+
<version>${maven-clean-plugin.version}</version>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-compiler-plugin</artifactId>
92+
<version>${maven-compiler-plugin.version}</version>
93+
<configuration>
94+
<compilerArgs>
95+
<arg>-XDcompilePolicy=simple</arg>
96+
<arg>-Xplugin:ErrorProne</arg>
97+
</compilerArgs>
98+
<annotationProcessorPaths>
99+
<path>
100+
<groupId>com.google.errorprone</groupId>
101+
<artifactId>error_prone_core</artifactId>
102+
<version>${error-prone.version}</version>
103+
</path>
104+
</annotationProcessorPaths>
105+
</configuration>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-deploy-plugin</artifactId>
110+
<version>${maven-deploy-plugin.version}</version>
111+
</plugin>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-enforcer-plugin</artifactId>
115+
<version>${maven-enforcer-plugin.version}</version>
116+
<configuration>
117+
<rules>
118+
<banDuplicatePomDependencyVersions/>
119+
<banDynamicVersions/>
120+
<banDuplicatePomDependencyVersions/>
121+
<banDynamicVersions/>
122+
<requireJavaVersion>
123+
<version>${java.version}</version>
124+
</requireJavaVersion>
125+
<requireMavenVersion>
126+
<version>3.3.9</version>
127+
</requireMavenVersion>
128+
<requirePluginVersions/>
129+
</rules>
130+
</configuration>
131+
<executions>
132+
<execution>
133+
<goals>
134+
<goal>enforce</goal>
135+
</goals>
136+
</execution>
137+
</executions>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-install-plugin</artifactId>
142+
<version>${maven-install-plugin.version}</version>
143+
</plugin>
144+
<plugin>
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-jar-plugin</artifactId>
147+
<version>${maven-jar-plugin.version}</version>
148+
</plugin>
149+
<plugin>
150+
<groupId>org.apache.maven.plugins</groupId>
151+
<artifactId>maven-resources-plugin</artifactId>
152+
<version>${maven-resources-plugin.version}</version>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.apache.maven.plugins</groupId>
156+
<artifactId>maven-shade-plugin</artifactId>
157+
<version>3.5.1</version>
158+
<executions>
159+
<execution>
160+
<goals>
161+
<goal>shade</goal>
162+
</goals>
163+
<phase>package</phase>
164+
<configuration>
165+
<relocations>
166+
<relocation>
167+
<pattern>com.fasterxml</pattern>
168+
<shadedPattern>org.shaded.fasterxml</shadedPattern>
169+
</relocation>
170+
</relocations>
171+
</configuration>
172+
</execution>
173+
</executions>
174+
</plugin>
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-site-plugin</artifactId>
178+
<version>${maven-site-plugin.version}</version>
179+
</plugin>
180+
<plugin>
181+
<groupId>org.apache.maven.plugins</groupId>
182+
<artifactId>maven-surefire-plugin</artifactId>
183+
<version>${maven-surefire-plugin.version}</version>
184+
</plugin>
185+
<plugin>
186+
<groupId>com.diffplug.spotless</groupId>
187+
<artifactId>spotless-maven-plugin</artifactId>
188+
<version>${spotless-maven-plugin.version}</version>
189+
<configuration>
190+
<java>
191+
<cleanthat>
192+
<version>${cleanthat.version}</version>
193+
</cleanthat>
194+
<removeUnusedImports/>
195+
<formatAnnotations/>
196+
<googleJavaFormat>
197+
<version>${google-java-format.version}</version>
198+
</googleJavaFormat>
199+
</java>
200+
<markdown>
201+
<includes>
202+
<include>**/*.md</include>
203+
</includes>
204+
<flexmark/>
205+
</markdown>
206+
<json>
207+
<includes>
208+
<include>src/**/*.json</include>
209+
</includes>
210+
<jackson/>
211+
</json>
212+
<!--
213+
POM rewriting conflicts with the maven-release-plugin.
214+
The release plugin rewrites the POM file in a way that is incompatible with spotless, and they change
215+
the contents back and forth to match their respective styles. -->
216+
<!--pom>
217+
<sortPom>
218+
<expandEmptyElements>false</expandEmptyElements>
219+
</sortPom>
220+
</pom-->
221+
</configuration>
222+
<executions>
223+
<execution>
224+
<goals>
225+
<goal>apply</goal>
226+
</goals>
227+
<phase>verify</phase>
228+
</execution>
229+
</executions>
230+
</plugin>
231+
</plugins>
232+
</build>
19233

20-
<dependencies>
21-
<dependency>
22-
<groupId>org.apache.hadoop</groupId>
23-
<artifactId>hadoop-common</artifactId>
24-
<version>${hadoop.version}</version>
25-
<scope>provided</scope>
26-
<exclusions>
27-
<exclusion>
28-
<groupId>*</groupId>
29-
<artifactId>*</artifactId>
30-
</exclusion>
31-
</exclusions>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.slf4j</groupId>
35-
<artifactId>slf4j-api</artifactId>
36-
<version>1.7.36</version>
37-
<scope>provided</scope>
38-
</dependency>
39-
<dependency>
40-
<groupId>com.fasterxml.jackson.core</groupId>
41-
<artifactId>jackson-databind</artifactId>
42-
<version>2.12.7.1</version>
43-
<scope>provided</scope>
44-
</dependency>
45-
<dependency>
46-
<groupId>junit</groupId>
47-
<artifactId>junit</artifactId>
48-
<version>4.13.1</version>
49-
<scope>test</scope>
50-
</dependency>
51-
</dependencies>
52-
<build>
53-
<plugins>
54-
<plugin>
55-
<groupId>org.apache.maven.plugins</groupId>
56-
<artifactId>maven-shade-plugin</artifactId>
57-
<version>3.5.1</version>
58-
<executions>
59-
<execution>
60-
<phase>package</phase>
61-
<goals>
62-
<goal>shade</goal>
63-
</goals>
64-
<configuration>
65-
<relocations>
66-
<relocation>
67-
<pattern>com.fasterxml</pattern>
68-
<shadedPattern>org.shaded.fasterxml</shadedPattern>
69-
</relocation>
70-
</relocations>
71-
</configuration>
72-
</execution>
73-
</executions>
74-
</plugin>
75-
<plugin>
76-
<groupId>org.apache.maven.plugins</groupId>
77-
<artifactId>maven-compiler-plugin</artifactId>
78-
<configuration>
79-
<source>11</source>
80-
<target>11</target>
81-
</configuration>
82-
</plugin>
83-
</plugins>
84-
</build>
85234
</project>

0 commit comments

Comments
 (0)