Closed LoloDigi closed 4 years ago
Have you tried https://maven.apache.org/plugins/maven-site-plugin/site-mojo.html#inputEncoding ?
It's also nice to have minimum project that can reproduce your problem.
Yes I did, with many values (ISO-8859-1, CP1252, UTF-8, ...) and combinations with many "outputEncoding" also. Perhaps most of projects are working in UTF-8...
@LoloDigi Can you provide a sample project that causes this issue?
It is true most projects are UTF-8 as that is the universal standard. You might want to determine a specific reason why your code base wants to use a legacy character encoding. Generally I've seen that used just due to improper setup when UTF-8 was fine but certainly we should work with any and a sample will help us better isolate the issue. Thanks in advance!
What do you need exactly ? Here the content of the XML generated by spotbugs maven plugin.
`
A small sample project that also has the issue, simple hello world will do.
I have the same issue. My OS (Windows 10) is configured in french. I was able to workaround the issue by configuring the language like this:
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<jvmArgs>-Duser.language=en</jvmArgs>
</configuration>
</plugin>
</plugins>
To reproduce the error you can set "fr" instead of "en" and run "mvn install site" on a project that contains issues detected by SpotBug.
@jflecomte Thanks, I'll take a deeper look as soon as I can.
@jflecomte The workaround is working great. Thank you for your support !
I'm not very good with groovy :( I took a stab at fixing the issue. I can get the xml to generate with the xml declaration but then it fails later when running a slurper against it as the declaration tag is not allowed. As the spotbugsXml.xml is just a smaller cut of spotbugsTemp.xml, I suspect that portion of the code is actually correct. It's possible later on it must be interpretted differently.
Issue resolved and will be available in plugin for spotbugs 4.0.0.
With the last spotbugs-maven-plugin, in 3.1.6 version, I'm not able to generate the maven-site report. It was OK with findbugs, but I can't make it work with spotbugs. My source and report encodings are CP1252 (I have many other reports like checkstyle, dependencies, javadoc, ...).
The generated spotbugsXml.xml does not contains a line like : <?xml version="1.0" encoding="CP1252"?>
So the maven-site plugin fails (assuming it is UTF-8) on the following error : Error during site generation: Invalid byte 2 of 3-byte UTF-8 sequence I was expecting that the outputEncoding parameter could set the XML encoding, but not.
Is that a bug or did I missed something ?