[SOLVED] Maven Build Failure: Error with checkstyle suppression file path

Hi all,

Recently when trying to Build my Binding I came across a maven build error that I cannot resolve. Originally I thought this was because I tried merging the master branch into my bindings branch (so that I could get it ready for a Pull Request into the main repo) but I’m not too well versed in maven - I’m sure this is an easy fix for the more experienced devs.

[ERROR] Failed to execute goal org.openhab.tools.sat:sat-plugin:0.5.0:checkstyle (default) on project org.openhab.binding.hpprinter: Unable to execute mojo: An error has occurred in Checkstyle report generation. 
Failed during checkstyle execution: Unable to find suppressions file at location: C:\Users\**redacted**\openhab2-master\git\openhab2-addons\addons\binding\org.openhab.binding.hpprinter\tools\checkstyle_suppressions.xml: 
Could not find resource 'C:\Users\**redacted**\openhab2-master\git\openhab2-addons\addons\binding\org.openhab.binding.hpprinter\tools\checkstyle_suppressions.xml'. -> [Help 1]

For some reason it suddenly appears to be checking my hpprinter bindings folder for the checkstyle_suppressions.xml file, but this file exists in the openhab2-addons/tools folder and has never been an issue before.

This issue has only started occuring for me a few days ago. I understand that there’s been a few changes going on with changing the licence and header requirements so I am wondering if a recent commit has caused this change. If anyone could provide any advice regarding how to resolve this I would be truly grateful.

Thanks all!

I don’t have a direct solution. But this seems a similar problem as reported in this issue:

I don’t know if it is the exact same problem. But in both cases it tries to resolve the suppressions file relative to the binding directory and not the project root.

Okay so I’ve got it working! :slight_smile:

In my case I believe it was because I had my Binding defined twice in the openhab2-addons\addons\binding\pom.xml file without realising it.

A small chance it may have also been due to some further updates to checkstyle or maven.

I have left the above information here for future reference in case someone comes across the same issue.