[BUILD-228] Update Checkstyle plugin so we can use lambdas Created: 05/May/16  Updated: 18/Oct/16  Resolved: 07/Jul/16

Status: Closed
Project: Build
Component/s: Poms
Affects Version/s: None
Fix Version/s: POMs 32

Type: Task Priority: Neutral
Reporter: Evzen Fochr Assignee: Mikaël Geljić
Resolution: Fixed Votes: 1
Labels: selected-for-backlog
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Release notes required:
Yes
Date of First Response:
Epic Link: Make build system Java 8 ready
Sprint: Saigon 51
Story Points: 2

 Description   

The current version of the checkstyle plugin we use, do not allow to use lambdas. (java 1.8)



 Comments   
Comment by Pete Ryland [ 19/May/16 ]

We're already on the latest version of the plugin offered by Jenkins. Someone already requested in January that it be updated to support a more recent version of Checkstyle (https://issues.jenkins-ci.org/browse/JENKINS-32501) but it has not yet been done.

Comment by Jan Haderka [ 30/May/16 ]

Actually what we want is to update our poms. Nothing to do w/ version in Jenkins.

What we need is:

<!-- java 8 support in checkstyle -->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-checkstyle-plugin</artifactId>
  <version>2.17</version>
  <dependencies>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <version>6.11.2</version>
    </dependency>
  </dependencies>
</plugin>
Comment by Mikaël Geljić [ 05/Jul/16 ]

That said, upon thinking about it, the fact that we use same parent poms for loads of modules, some still with java6 compliance—which are currently no longer built with java 6 on jenkins anyway (so we don't see problems)—supposedly we could only go as far as pluginVersion 2.15 for the 5.3 series, 2.17 with Checkstyle 6 on 5.4, 2.17 with Checkstyle 7 on 5.5...

Smells like a profile or property, unless we can derive that conf from javaVersion props, but unlikely. Or even further down the road, branching parent poms. On the one hand, it would make sense cuz our major branches have different java compliance, so different dependencies and so on... on the other hand, we never went down that road for good reason too (propagate java-independent changes to all branches easily).

EDIT: For the sake of completeness:

  Plugin version Checkstyle version
Current (Poms 31) 2.13 5.8
First support of Java 8 syntax - 5.9
Last JDK6 runtime compliance 2.15 6.1.1
Last JDK7 runtime compliance 2.17 6.19
Java 8+ runtime compliance - 7.0

So there is actually an alternative "baby step": we could go w/ plugin 2.15 on checkstyle 6.1.1. How does that sound?

Comment by Mikaël Geljić [ 05/Jul/16 ]

On the better news side,

Checkstyle version 6.11.2 is only the plugin default version, i.e. at time of release 2.17. This version fails upon our non-empty/first-sentence javadoc module

<module name="JavadocStyle">
  <property name="checkFirstSentence" value="true"/>
  <property name="checkEmptyJavadoc" value="false"/>
</module>

This was broken since 6.10.1 (6.10 is unusable w/ maven plugin anyway) and is cured as of version 6.14, though I couldn't find any corresponding mention on release notes. At least, no update required to our checkstyle config for now. Any checkstyle version within that range is unusable for us.

Comment by Mikaël Geljić [ 05/Jul/16 ]

Successfully tested with lambdas & method refs

Generated at Sun Feb 11 23:39:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.