Skip to content

Commit 3893e21

Browse files
committed
Use <pluginManagement>, not <properties>
1 parent e484b61 commit 3893e21

File tree

1 file changed

+74
-35
lines changed

1 file changed

+74
-35
lines changed

pom.xml

Lines changed: 74 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -160,42 +160,35 @@
160160
</dependency>
161161
</dependencies>
162162
</plugin>
163+
<plugin>
164+
<groupId>com.github.spotbugs</groupId>
165+
<artifactId>spotbugs-maven-plugin</artifactId>
166+
<version>${spotbugs.maven.plugin.version}</version>
167+
<executions>
168+
<execution>
169+
<phase>package</phase>
170+
<goals>
171+
<goal>check</goal>
172+
</goals>
173+
</execution>
174+
</executions>
175+
<dependencies>
176+
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
177+
<dependency>
178+
<groupId>com.github.spotbugs</groupId>
179+
<artifactId>spotbugs</artifactId>
180+
<version>${com.github.spotbugs.version}</version>
181+
</dependency>
182+
</dependencies>
183+
</plugin>
163184
</plugins>
164185
</pluginManagement>
165186
<plugins>
166-
<plugin>
167-
<groupId>com.github.spotbugs</groupId>
168-
<artifactId>spotbugs-maven-plugin</artifactId>
169-
<version>${spotbugs.maven.plugin.version}</version>
170-
<executions>
171-
<execution>
172-
<phase>package</phase>
173-
<goals>
174-
<goal>check</goal>
175-
</goals>
176-
</execution>
177-
</executions>
178-
<dependencies>
179-
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
180-
<dependency>
181-
<groupId>com.github.spotbugs</groupId>
182-
<artifactId>spotbugs</artifactId>
183-
<version>${com.github.spotbugs.version}</version>
184-
</dependency>
185-
</dependencies>
186-
</plugin>
187187
<plugin>
188188
<groupId>org.codehaus.mojo</groupId>
189189
<artifactId>versions-maven-plugin</artifactId>
190190
<version>${versions-maven-plugin.version}</version>
191191
<configuration>
192-
<excludes>
193-
<exclude>com.github.spotbugs:spotbugs</exclude>
194-
<exclude>com.github.spotbugs:spotbugs-maven-plugin</exclude>
195-
<exclude>com.google.errorprone:error_prone_core</exclude>
196-
<exclude>org.apache.maven:maven-compiler-plugin</exclude>
197-
<exclude>org.codehaus.plexus:plexus-compiler-javac-errorprone</exclude>
198-
</excludes>
199192
<ignoredVersions>(?i).+[-.](alpha|beta|cr|dev|m|rc)([-.]?\d+)?</ignoredVersions>
200193
</configuration>
201194
</plugin>
@@ -278,13 +271,59 @@
278271
<activation>
279272
<jdk>1.8</jdk>
280273
</activation>
281-
<properties>
282-
<com.github.spotbugs.version>4.8.6</com.github.spotbugs.version>
283-
<error.prone.core.version>2.3.4</error.prone.core.version>
284-
<maven.compiler.plugin.version>3.12.0</maven.compiler.plugin.version>
285-
<plexus.compiler.javac.errorprone.version>2.8.6</plexus.compiler.javac.errorprone.version>
286-
<spotbugs.maven.plugin.version>4.8.6.6</spotbugs.maven.plugin.version>
287-
</properties>
274+
<build>
275+
<pluginManagement>
276+
<plugins>
277+
<plugin>
278+
<groupId>org.apache.maven.plugins</groupId>
279+
<artifactId>maven-compiler-plugin</artifactId>
280+
<version>3.12.0</version>
281+
<configuration>
282+
<compilerId>javac-with-errorprone</compilerId>
283+
<forceJavacCompilerUse>true</forceJavacCompilerUse>
284+
<showDeprecation>true</showDeprecation>
285+
<compilerArgs>
286+
<arg>-Xlint</arg>
287+
</compilerArgs>
288+
</configuration>
289+
<dependencies>
290+
<dependency>
291+
<groupId>org.codehaus.plexus</groupId>
292+
<artifactId>plexus-compiler-javac-errorprone</artifactId>
293+
<version>2.8.6</version>
294+
</dependency>
295+
<!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the latest version -->
296+
<dependency>
297+
<groupId>com.google.errorprone</groupId>
298+
<artifactId>error_prone_core</artifactId>
299+
<version>2.3.4</version>
300+
</dependency>
301+
</dependencies>
302+
</plugin>
303+
<plugin>
304+
<groupId>com.github.spotbugs</groupId>
305+
<artifactId>spotbugs-maven-plugin</artifactId>
306+
<version>4.8.6.6</version>
307+
<executions>
308+
<execution>
309+
<phase>package</phase>
310+
<goals>
311+
<goal>check</goal>
312+
</goals>
313+
</execution>
314+
</executions>
315+
<dependencies>
316+
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
317+
<dependency>
318+
<groupId>com.github.spotbugs</groupId>
319+
<artifactId>spotbugs</artifactId>
320+
<version>4.8.6</version>
321+
</dependency>
322+
</dependencies>
323+
</plugin>
324+
</plugins>
325+
</pluginManagement>
326+
</build>
288327
</profile>
289328
<profile>
290329
<id>release</id>

0 commit comments

Comments
 (0)