violations-plugin
violations-plugin copied to clipboard
Fixing 'no violations found' file links on Windows (Issue #50)
This is the fix as described in issue 50. I ran across the issue on Jenkins running on Windows server. The problem is that all the file keys in the FileModelProxy use the file separator for the system (*nix='/', windows=''), but the String name
here comes from getRestOfPath()
which prefers the url forward slash (which doesn't work for the Windows keys). To transform the "rest of path" to the true file key, we must convert any '/' in the name to the File.separator for the system.
I should mention this is only an issue if your files are located within subfolders and your Jenkins is running on Windows. I confirmed it was still an issue in the latest snapshot and this change fixes it.