Hans Meier
Hans Meier

Reputation: 3

Eclipse Checkstyle plugin (eclipse-cs) Error Property has not been set

I try to use eclipse-cs (eclipse checkstyle plugin) in our Eclipse 4 teamproject.

The idea is that we define one checkstyle.xml for our team and have this checkstyle.xml under sourcecontrol.

The Project structure looks like this

According to the documentation it should be possible defining relative paths with the ${property} style pattern(s)...

When I try to define the location for the checkstyle.xml I get an error "Property xy has not been set".

Dialog for setting the checkstyle-configuration file

What I'm doing wrong ?

Upvotes: 0

Views: 1006

Answers (2)

barfuin
barfuin

Reputation: 17494

I would assume that PluginProjectFolder1, PluginProjectFolder2, and Checkstyle.xml are all inside your Eclipse workspace. If they are not, then that is what you should try to do, e.g. by including an Eclipse project called WorkspaceConfig or some such which includes the checkstyle.xml.

Then, in order to achieve what you describe, you can select "project relative configuration" from the dropdown box. This actually refers to the Eclipse workspace. Select WorkspaceConfig/checkstyle.xml, and there you have it: The checkstyle.xml is under version control, and it will not matter where the developer's workspace is located on his PC.

An added advantage is that such a configuration will work out of the box, without required extra configuration steps such as defining classpath variables.

Upvotes: 0

greg-449
greg-449

Reputation: 111217

The documentation you reference says:

To do this use ${property} style pattern(s) in the location string, these patterns will be resolved from equally named Classpath Variables or Environment properties (passed into Eclipse via -D parameter)

${project_loc} is not a Classpath variable or an environment property. It is an Eclipse String Variable which is different and the dialog needs to have specifically added code to support it. It looks like this dialog has not done that.

You can define Classpath variables in the Preferences in 'Java > Build Path > Classpath Variables'

Upvotes: 1

Related Questions