views:

470

answers:

1

I have configured my Eclipse to use a remote checkstyle configuration that is located on a server, which I reach via HTTP. This works fine, but the configuration contains:

<module name="SuppressionFilter">
<property name="file" value="${basedir}/checkstyle-filter.xml"/>
</module>

So I try to set an additional property "basedir" which points to the same directory where the configuration is. When I try to run checkstyle on a project I get an error: cannot initialize module SuppressionsFilter - Cannot set property 'file' in module SuppressionFilter to 'http://"my Url "/checkstyle-filter.xml'

Any suggestions on how to configure Eclipse to use the checkstyle configuration from the server even though it has that it contains the SuppressionFilter? I do not want to put a checkstyle-filter in each project...

+3  A: 

This is currently not possible as reported in Remote Configuration Files cannot use a SuppressionFilter - ID: 2018081. Actually, the problem is in Checkstyle which uses a java.io.File object for the external SuppressionFilter file (and thus setting a value starting with http:// won't work). There is a feature request on Checkstyle to change this (see Allow remote references to additional file configuration - ID: 2018608). But don't expect these changes to occur very soon (unless if you start working hard on it :)

That being said, while I perfectly understand the need for a corporate wide checkstyle configuration file, I'm more surprised by the need for a shared SuppressionFilter file. After all, its content is project specific, isn't it? So, I think that you should actually use another property, for example ${workspace} (or your own property, my understanding of Expanding property placeholders is that using a .properties file is supposed to work with a Remote Configuration too) and ask each project to provide its own file with its SuppressionFilter that would be referenced from the workspace. Based on convention, that should work.

Pascal Thivent
Thank you very much for the detailed answer. The thing is that the projects are all very similar in the way that they all generate source code that does not conform with the checkstyle configuration, and does not need to do that either. I will skip to have it as remote configuration, I will just use the extensionpoints in eclipse-cs and include the confuiguration in a plugin which I include in the distribution.
Ingo
You're welcome. And now I understand better, it would make sense in your case indeed. BTW: The common way of recognizing a good answer is upvoting it ;-).
Pascal Thivent
I'm new to Stackoverflow and get a "Vote Uprequires 15 reputation", I will upvote it once I reach there. Guess I should contribute and answer some posts myself ;)I'll keep that in mind, thanx
Ingo