Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Path to Subset #147

Open
numeralnathan opened this issue May 23, 2021 · 2 comments
Open

Relative Path to Subset #147

numeralnathan opened this issue May 23, 2021 · 2 comments

Comments

@numeralnathan
Copy link

How do I force the PMD Eclipse plugin to use the latest version of the ruleset? The ruleset is in a file on the local disk. I am not sure if this is a missing feature, lack of documentation or my lack of Google skills.

I configured the PMD Eclipse plugin to use a ruleset in the file system. I opened the ruleset in an Eclipse editor. I added a rule to the file and saved it. In the Package Explorer, I right-clicked on a Java file and in the menu clicked PMD > Check Code. The new rule was not used.

If I run PMD on the command line using the ruleset, PMD flags the problems from the new rule. This suggests to me that the PMD Eclipse plugin is not picking up the latest version of the ruleset.

In the menu bar, I clicked on Project > Clean (which rebuilds the project). The PMD Eclipse plugin did not pick up the latest version of the ruleset.

In the menu bar, I clicked File > Restart. The PMD Eclipse plugin did pick up the latest version of the ruleset. This is very slow and seems to be overkill.

In the project properties > PMD, I changed the properties, clicked Apply & Close, and rebuilt the project. The PMD Eclipse plugin did not pick up the latest version of the ruleset.

Note: PMD rulesets can be a hierarchy of files. If any one of the files changes, then the PMD Eclipse plugin should reload the ruleset.

@numeralnathan
Copy link
Author

PMD Eclipse plugin does reload the ruleset. The problem is that it would fail to load the ruleset because of this relative path.

<rule ref="rulesets/PMD_ruleset_subset.xml"/>

If I give the full path like below, then the plugin reloads the ruleset.

<rule ref="C:/full/path/rulesets/PMD_ruleset_subset.xml"/>

How do I specify a relative path. Let's assume the base ruleset and PMD_ruleset_subset.xml are in the same directory rulesets. rulesets is a directory in the project.

@numeralnathan numeralnathan changed the title Force Ruleset Reload Relative Path to Subset May 23, 2021
@SoerenHenning
Copy link

I'm having the same issue. Is there any way to configure a relative path to a ruleset file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants