WARN: Invalid character encountered in file <file.zip> at line 2 for encoding UTF-8

287 views
Skip to first unread message

ros...@gmail.com

unread,
Mar 8, 2017, 1:46:22 PM3/8/17
to SonarQube
I'm trying to perform scan during appveyor but it's failed due encoding warning.

I'm also trying to set encoding in run parameter: /d:sonar.sourceEncoding="UTF-8" but no luck.
And trying to exclude this file: /d:sonar.exclusions="**/*.zip" and also no luck.

MSBuild.SonarQube.Runner.exe : WARN: Invalid character encountered in file C:\projects\webdrivermanager-net\IntegrationTests\Assets\removable.zip at line 2 for encoding UTF-8. Please fix file content or configure the encoding to
be used using property 'sonar.sourceEncoding'.
At line:1 char:1
+ MSBuild.SonarQube.Runner.exe end /d:sonar.login=$env:SonarToken
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (WARN: Invalid c...ourceEncoding'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
WARN: Invalid character encountered in file C:\projects\webdrivermanager-net\IntegrationTests\Assets\unzipable.zip at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property
'sonar.sourceEncoding'.

Julien HENRY

unread,
Mar 9, 2017, 4:46:45 AM3/9/17
to SonarQube, ros...@gmail.com
Hi,

What is the version of SonarQube you are using?

Thanks,

Julien

ros...@gmail.com

unread,
Mar 9, 2017, 9:20:17 AM3/9/17
to SonarQube, ros...@gmail.com
Hello,

I'm using msbuild-sonarqube-runner latest version (2.1) from chocolatey.
And check perform on https://sonarqube.com host.
Sorry, but i don't exactly know what version of sonarqube there. I think the latest one.

Thanks,
Alex

Jan Sandquist

unread,
Mar 9, 2017, 12:46:47 PM3/9/17
to SonarQube
Hi Alex,
I doubt the warning causes it to fail but not familiar with your environment.

The zip file is probably categorized as a test asset so try setting
sonar.global.test.exclusions = **/*.zip
or sonar.test.exclusions.

Regards,
Jan

ros...@gmail.com

unread,
Mar 9, 2017, 1:28:42 PM3/9/17
to SonarQube
Hi,

Thanks for reply.
Both variant works well.

Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages