Skip to content

Commit 26d7fe1

Browse files
committed
Updated maven configuration
* Added JaCoCo plugin * Updated ErroProne config
1 parent 6ed335e commit 26d7fe1

File tree

1 file changed

+152
-99
lines changed

1 file changed

+152
-99
lines changed

pom.xml

Lines changed: 152 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<version>0.0.1-SNAPSHOT</version>
1010

1111
<properties>
12-
<maven.compiler.source>21</maven.compiler.source>
13-
<maven.compiler.target>21</maven.compiler.target>
12+
<java.version>21</java.version>
1413
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1514
<spotless-maven-plugin.version>3.0.0</spotless-maven-plugin.version>
1615
<palantir-formatter.version>2.69.0</palantir-formatter.version>
@@ -19,6 +18,7 @@
1918
<error-prone.version>2.42.0</error-prone.version>
2019
<nullaway.version>0.12.10</nullaway.version>
2120
<jspecify.version>1.0.0</jspecify.version>
21+
<jacoco-maven-plugin.version>0.8.9</jacoco-maven-plugin.version>
2222
</properties>
2323

2424
<dependencyManagement>
@@ -39,115 +39,168 @@
3939
</dependencies>
4040

4141
<build>
42+
<pluginManagement>
43+
<plugins>
44+
<!-- Spotless code formatter -->
45+
<plugin>
46+
<groupId>com.diffplug.spotless</groupId>
47+
<artifactId>spotless-maven-plugin</artifactId>
48+
<version>${spotless-maven-plugin.version}</version>
49+
<configuration>
50+
<java>
51+
<palantirJavaFormat>
52+
<version>${palantir-formatter.version}</version>
53+
<style>PALANTIR</style>
54+
<formatJavadoc>true</formatJavadoc>
55+
</palantirJavaFormat>
56+
<importOrder>
57+
<order>java,javax,org,com,,\#</order>
58+
</importOrder>
59+
<removeUnusedImports/>
60+
<formatAnnotations/>
61+
<trimTrailingWhitespace/>
62+
<endWithNewline/>
63+
<indent>
64+
<spaces>true</spaces>
65+
<spacesPerTab>4</spacesPerTab>
66+
</indent>
67+
<lineEndings>UNIX</lineEndings>
68+
</java>
69+
<yaml>
70+
<includes>
71+
<include>.github/dependabot.yml</include>
72+
<include>.github/workflows/build.yml</include>
73+
</includes>
74+
<trimTrailingWhitespace/>
75+
<endWithNewline/>
76+
<indent>
77+
<spaces>true</spaces>
78+
<spacesPerTab>2</spacesPerTab>
79+
</indent>
80+
<lineEndings>UNIX</lineEndings>
81+
</yaml>
82+
</configuration>
83+
<executions>
84+
<execution>
85+
<goals>
86+
<goal>check</goal>
87+
</goals>
88+
<phase>validate</phase>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
<!-- Maven Enforcer to enforce various rules -->
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-enforcer-plugin</artifactId>
96+
<version>${maven-enforcer-plugin.version}</version>
97+
<executions>
98+
<execution>
99+
<goals>
100+
<goal>enforce</goal>
101+
</goals>
102+
<configuration>
103+
<rules>
104+
<banDuplicatePomDependencyVersions/>
105+
<banDynamicVersions/>
106+
<bannedDependencies>
107+
<excludes>
108+
<exclude>org.apache.logging.log4j:log4j-core:[,2.17.0]</exclude>
109+
<searchTransitive>true</searchTransitive>
110+
</excludes>
111+
</bannedDependencies>
112+
<dependencyConvergence/>
113+
<requireJavaVersion>
114+
<version>${java.version}</version>
115+
</requireJavaVersion>
116+
</rules>
117+
<fail>true</fail>
118+
</configuration>
119+
</execution>
120+
</executions>
121+
</plugin>
122+
<!-- Maven compiler plugin to enforce Java version and enable annotation processors -->
123+
<plugin>
124+
<groupId>org.apache.maven.plugins</groupId>
125+
<artifactId>maven-compiler-plugin</artifactId>
126+
<version>${maven-compiler-plugin.version}</version>
127+
<configuration>
128+
<source>${java.version}</source>
129+
<target>${java.version}</target>
130+
<encoding>UTF-8</encoding>
131+
<showWarnings>true</showWarnings>
132+
<failOnWarning>true</failOnWarning>
133+
<compilerArgs>
134+
<arg>-XDcompilePolicy=simple</arg>
135+
<arg>--should-stop=ifError=FLOW</arg>
136+
<arg>-Xplugin:ErrorProne
137+
-Xep:WildcardImport:ERROR
138+
-XepDisableWarningsInGeneratedCode
139+
-XepOpt:NullAway:TreatGeneratedAsUnannotated=true
140+
-XepOpt:NullAway:AnnotatedPackages=io.company
141+
-XepOpt:NullAway:AcknowledgeRestrictiveAnnotations=true
142+
</arg>
143+
</compilerArgs>
144+
<annotationProcessorPaths>
145+
<path>
146+
<groupId>com.google.errorprone</groupId>
147+
<artifactId>error_prone_core</artifactId>
148+
<version>${error-prone.version}</version>
149+
</path>
150+
<path>
151+
<groupId>com.uber.nullaway</groupId>
152+
<artifactId>nullaway</artifactId>
153+
<version>${nullaway.version}</version>
154+
</path>
155+
<!-- Other annotation processors go here.
156+
157+
If 'annotationProcessorPaths' is set, processors will no longer be
158+
discovered on the regular -classpath; see also 'Using Error Prone
159+
together with other annotation processors' below. -->
160+
</annotationProcessorPaths>
161+
</configuration>
162+
</plugin>
163+
<!-- JaCoCo Code Coverage -->
164+
<plugin>
165+
<groupId>org.jacoco</groupId>
166+
<artifactId>jacoco-maven-plugin</artifactId>
167+
<version>${jacoco-maven-plugin.version}</version>
168+
<executions>
169+
<execution>
170+
<goals>
171+
<goal>prepare-agent</goal>
172+
</goals>
173+
<configuration>
174+
<propertyName>argLine</propertyName>
175+
</configuration>
176+
</execution>
177+
<execution>
178+
<id>report</id>
179+
<phase>verify</phase>
180+
<goals>
181+
<goal>report-aggregate</goal>
182+
</goals>
183+
</execution>
184+
</executions>
185+
</plugin>
186+
</plugins>
187+
</pluginManagement>
42188
<plugins>
43189
<plugin>
44190
<groupId>com.diffplug.spotless</groupId>
45191
<artifactId>spotless-maven-plugin</artifactId>
46-
<version>${spotless-maven-plugin.version}</version>
47-
<configuration>
48-
<java>
49-
<palantirJavaFormat>
50-
<version>${palantir-formatter.version}</version>
51-
<style>PALANTIR</style>
52-
<formatJavadoc>true</formatJavadoc>
53-
</palantirJavaFormat>
54-
<removeUnusedImports/>
55-
<formatAnnotations/>
56-
<trimTrailingWhitespace/>
57-
<endWithNewline/>
58-
<importOrder>
59-
<order>\#,java,org,com,</order>
60-
</importOrder>
61-
<indent>
62-
<spaces>true</spaces>
63-
<spacesPerTab>4</spacesPerTab>
64-
</indent>
65-
<lineEndings>UNIX</lineEndings>
66-
</java>
67-
<yaml>
68-
<includes>
69-
<include>.github/dependabot.yml</include>
70-
<include>.github/workflows/build.yml</include>
71-
</includes>
72-
<trimTrailingWhitespace/>
73-
<endWithNewline/>
74-
<indent>
75-
<spaces>true</spaces>
76-
<spacesPerTab>2</spacesPerTab>
77-
</indent>
78-
<lineEndings>UNIX</lineEndings>
79-
</yaml>
80-
</configuration>
81-
<executions>
82-
<execution>
83-
<goals>
84-
<goal>check</goal>
85-
</goals>
86-
<phase>validate</phase>
87-
</execution>
88-
</executions>
89192
</plugin>
90193
<plugin>
91194
<groupId>org.apache.maven.plugins</groupId>
92195
<artifactId>maven-enforcer-plugin</artifactId>
93-
<version>${maven-enforcer-plugin.version}</version>
94-
<executions>
95-
<execution>
96-
<goals>
97-
<goal>enforce</goal>
98-
</goals>
99-
<configuration>
100-
<rules>
101-
<banDuplicatePomDependencyVersions/>
102-
<banDynamicVersions/>
103-
<bannedDependencies>
104-
<excludes>
105-
<exclude>org.apache.logging.log4j:log4j-core:[,2.17.0]</exclude>
106-
<searchTransitive>true</searchTransitive>
107-
</excludes>
108-
</bannedDependencies>
109-
<dependencyConvergence/>
110-
<requireJavaVersion>
111-
<version>21</version>
112-
</requireJavaVersion>
113-
</rules>
114-
<fail>true</fail>
115-
</configuration>
116-
</execution>
117-
</executions>
118196
</plugin>
119197
<plugin>
120198
<groupId>org.apache.maven.plugins</groupId>
121199
<artifactId>maven-compiler-plugin</artifactId>
122-
<version>${maven-compiler-plugin.version}</version>
123-
<configuration>
124-
<source>${maven.compiler.source}</source>
125-
<target>${maven.compiler.target}</target>
126-
<encoding>UTF-8</encoding>
127-
<compilerArgs>
128-
<arg>-XDcompilePolicy=simple</arg>
129-
<arg>--should-stop=ifError=FLOW</arg>
130-
<arg>-Xplugin:ErrorProne -XepOpt:NullAway:AnnotatedPackages=io.company</arg>
131-
</compilerArgs>
132-
<failOnWarning>true</failOnWarning>
133-
<annotationProcessorPaths>
134-
<path>
135-
<groupId>com.google.errorprone</groupId>
136-
<artifactId>error_prone_core</artifactId>
137-
<version>${error-prone.version}</version>
138-
</path>
139-
<path>
140-
<groupId>com.uber.nullaway</groupId>
141-
<artifactId>nullaway</artifactId>
142-
<version>${nullaway.version}</version>
143-
</path>
144-
<!-- Other annotation processors go here.
145-
146-
If 'annotationProcessorPaths' is set, processors will no longer be
147-
discovered on the regular -classpath; see also 'Using Error Prone
148-
together with other annotation processors' below. -->
149-
</annotationProcessorPaths>
150-
</configuration>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.jacoco</groupId>
203+
<artifactId>jacoco-maven-plugin</artifactId>
151204
</plugin>
152205
</plugins>
153206
</build>

0 commit comments

Comments
 (0)