diff options
author | John J. Franey <john.franey@att.com> | 2019-09-19 12:27:10 -0400 |
---|---|---|
committer | Brian Freeman <bf1936@att.com> | 2019-11-18 13:30:25 +0000 |
commit | 6a2d8c71aa39a6f47a683c38267c07cd9a00dfeb (patch) | |
tree | 0963146d1260b1ca612d2a13d8a89be95d02260c /oparent | |
parent | fcd164ac91e84e98af66e7f3bb285a4ae35723ec (diff) |
update version of checkstyle for latest google style and jdk 8
Upgrade to use the latest google style (plus onap style).
This latest style adds rules for jdk 8 source level.
Upgrade the version of checkstyle to 8.24. The latest google
style rules are compatible with 8.24 and later.
Upgrade checkstyle maven plugin to 3.1.0 (from 2.17).
This jdk8 version of checkstyle is active only when the build-time
java runtime is jdk8 or later, otherwise, the original checkstyle
is active.
Issue-ID: INT-1271
Change-Id: Ib190b39efc5a6028ab4874301e6a813f0a36b138
Signed-off-by: John J. Franey <john.franey@att.com>
Diffstat (limited to 'oparent')
-rw-r--r-- | oparent/pom.xml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/oparent/pom.xml b/oparent/pom.xml index ec1c865..6fc37e3 100644 --- a/oparent/pom.xml +++ b/oparent/pom.xml @@ -273,6 +273,60 @@ </dependency> </dependencies> </profile> + <profile> + <activation> + <jdk>[1.8,)</jdk> + </activation> + <!-- overrides oparent's existing checkstyle to check java 8 code --> + <id>checkstyle-jdk8</id> + <build> + <plugins> + <plugin> + <!-- + - override the original oparent checkstyle configuration to + - use a later version of checkstyle which is jdk8 aware, and + - use an updated checkstyle config that conforms to onap style and the later checkstyle format. + --> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>3.1.0</version> + <dependencies> + <dependency> + <!-- because google's latest style is not supported by plugin's default version--> + <groupId>com.puppycrawl.tools</groupId> + <artifactId>checkstyle</artifactId> + <version>8.24</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>onap-license</id> + <configuration> + <!-- this config not supported by checkstyle any more --> + <sourceDirectory combine.self="override"/> + <sourceDirectories> + <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> + </sourceDirectories> + </configuration> + </execution> + <execution> + <id>onap-java-style</id> + <configuration> + <!-- Use Google Java Style Guide: + https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml + with minor changes --> + <configLocation>onap-checkstyle/onap-java-style${maven.compiler.source}.xml</configLocation> + <!-- this config not supported by checkstyle any more --> + <sourceDirectory combine.self="override"/> + <sourceDirectories> + <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> + </sourceDirectories> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> <dependencyManagement> <dependencies> |