java: allow eclipse checkstyle to work Eclipse's checkstyle plugin doesn't properly handle paths relative to the checkstyle configuration XML file. The workaround is that it does provide a "samedir" property which can be used to construct the proper absolute path. Of course, Maven doesn't provide that property by default, so this patch also edits the pom so that Maven passes in "./" as "samedir".
Change-Id: Ibb8c2d180b8c931b4e83ec5244f4b2e54155c5e4 Reviewed-on: http://gerrit.cloudera.org:8080/5943 Reviewed-by: Dan Burkert <[email protected]> Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/3642e1ff Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3642e1ff Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3642e1ff Branch: refs/heads/master Commit: 3642e1ff81934e497d39f0b1d1336e461aa53ebd Parents: a25162a Author: Todd Lipcon <[email protected]> Authored: Wed Feb 8 11:47:46 2017 -0800 Committer: Todd Lipcon <[email protected]> Committed: Wed Feb 8 21:35:12 2017 +0000 ---------------------------------------------------------------------- java/kudu_style.xml | 4 ++-- java/pom.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/3642e1ff/java/kudu_style.xml ---------------------------------------------------------------------- diff --git a/java/kudu_style.xml b/java/kudu_style.xml index 1db1e35..9694462 100644 --- a/java/kudu_style.xml +++ b/java/kudu_style.xml @@ -51,7 +51,7 @@ <module name="SuppressionCommentFilter"/> <!-- Suppress generated sources --> <module name="SuppressionFilter"> - <property name="file" value="checkstyle_suppressions.xml"/> + <property name="file" value="${samedir}/checkstyle_suppressions.xml"/> <property name="optional" value="false"/> </module> <module name="TreeWalker"> @@ -251,4 +251,4 @@ <property name="message" value="Trailing whitespace"/> </module> </module> -</module> \ No newline at end of file +</module> http://git-wip-us.apache.org/repos/asf/kudu/blob/3642e1ff/java/pom.xml ---------------------------------------------------------------------- diff --git a/java/pom.xml b/java/pom.xml index cdc5153..f4d76aa 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -256,6 +256,7 @@ <phase>validate</phase> <configuration> <configLocation>kudu_style.xml</configLocation> + <propertyExpansion>samedir=.</propertyExpansion> <encoding>UTF-8</encoding> <consoleOutput>true</consoleOutput> <failsOnError>false</failsOnError>
