|
188 | 188 | </plugin> |
189 | 189 |
|
190 | 190 | <plugin> |
191 | | - <groupId>com.mycila.maven-license-plugin</groupId> |
192 | | - <artifactId>maven-license-plugin</artifactId> |
193 | | - <version>1.10.b1</version> |
| 191 | + <groupId>com.diffplug.spotless</groupId> |
| 192 | + <artifactId>spotless-maven-plugin</artifactId> |
| 193 | + <version>2.43.0</version> |
194 | 194 | <configuration> |
195 | | - <header>LICENSE</header> |
196 | | - <strictCheck>true</strictCheck> |
197 | | - <skipExistingHeaders>true</skipExistingHeaders> |
198 | | - <includes> |
199 | | - <include>src/main/java/**/*.java</include> |
200 | | - </includes> |
| 195 | + <upToDateChecking> |
| 196 | + <enabled>true</enabled> |
| 197 | + <indexFile>tmp/spotless</indexFile> |
| 198 | + </upToDateChecking> |
| 199 | + <formats> |
| 200 | + <!-- you can define as many formats as you want, each is independent --> |
| 201 | + <format> |
| 202 | + <!-- define the files to apply to --> |
| 203 | + <includes> |
| 204 | + <include>*.java</include> |
| 205 | + </includes> |
| 206 | + <!-- define the steps to apply to those files --> |
| 207 | + <trimTrailingWhitespace/> |
| 208 | + <endWithNewline/> |
| 209 | + </format> |
| 210 | + </formats> |
| 211 | + <java> |
| 212 | + <googleJavaFormat> |
| 213 | + <reflowLongStrings>true</reflowLongStrings> |
| 214 | + </googleJavaFormat> |
| 215 | + |
| 216 | + <formatAnnotations /> |
| 217 | + |
| 218 | + <importOrder> |
| 219 | + <order>java,javax,org,</order> |
| 220 | + </importOrder> |
| 221 | + |
| 222 | + <licenseHeader> |
| 223 | + <file>LICENSE</file> |
| 224 | + </licenseHeader> |
| 225 | + </java> |
201 | 226 | </configuration> |
202 | | - <executions> |
203 | | - <execution> |
204 | | - <phase>verify</phase> |
205 | | - <goals> |
206 | | - <goal>format</goal> |
207 | | - </goals> |
208 | | - </execution> |
209 | | - </executions> |
210 | 227 | </plugin> |
211 | 228 |
|
212 | 229 | <!-- Deploy plugin --> |
|
256 | 273 | </build> |
257 | 274 | </profile> |
258 | 275 |
|
| 276 | + <profile> |
| 277 | + <id>git-hooks</id> |
| 278 | + <activation> |
| 279 | + <file> |
| 280 | + <exists>${pre-commit-hook}</exists> |
| 281 | + </file> |
| 282 | + </activation> |
| 283 | + <build> |
| 284 | + <plugins> |
| 285 | + <plugin> |
| 286 | + <groupId>org.apache.maven.plugins</groupId> |
| 287 | + <artifactId>maven-antrun-plugin</artifactId> |
| 288 | + <version>${maven-antrun-plugin.version}</version> |
| 289 | + <executions> |
| 290 | + <execution> |
| 291 | + <id>formatter.sh</id> |
| 292 | + <phase>initialize</phase> |
| 293 | + <configuration> |
| 294 | + <target> |
| 295 | + <chmod file="${pre-commit-hook}" perm="755"/> |
| 296 | + </target> |
| 297 | + </configuration> |
| 298 | + <goals> |
| 299 | + <goal>run</goal> |
| 300 | + </goals> |
| 301 | + </execution> |
| 302 | + </executions> |
| 303 | + </plugin> |
| 304 | + <!-- Git Hooks --> |
| 305 | + <plugin> |
| 306 | + <groupId>com.rudikershaw.gitbuildhook</groupId> |
| 307 | + <artifactId>git-build-hook-maven-plugin</artifactId> |
| 308 | + <version>3.4.1</version> |
| 309 | + <configuration> |
| 310 | + <installHooks> |
| 311 | + <pre-commit>${pre-commit-hook}</pre-commit> |
| 312 | + </installHooks> |
| 313 | + </configuration> |
| 314 | + <executions> |
| 315 | + <execution> |
| 316 | + <id>install-hooks</id> |
| 317 | + <goals> |
| 318 | + <goal>install</goal> |
| 319 | + </goals> |
| 320 | + </execution> |
| 321 | + </executions> |
| 322 | + </plugin> |
| 323 | + </plugins> |
| 324 | + </build> |
| 325 | + </profile> |
| 326 | + |
259 | 327 | <profile> |
260 | 328 | <id>sonatype</id> |
261 | 329 | <build> |
|
350 | 418 | <jackson2-version>2.14.0-rc2</jackson2-version> |
351 | 419 | <jacoco.version>0.8.11</jacoco.version> |
352 | 420 | <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format> |
| 421 | + <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version> |
353 | 422 | <timestamp>${maven.build.timestamp}</timestamp> |
354 | 423 | <maven.compiler.source>17</maven.compiler.source> |
355 | 424 | <maven.compiler.target>17</maven.compiler.target> |
| 425 | + <pre-commit-hook>src${file.separator}etc${file.separator}formatter.sh</pre-commit-hook> |
356 | 426 | </properties> |
357 | 427 | </project> |
0 commit comments