Facing warning while running sonar scanner

Sonarqube Community Build and Sonar Scanner 7.0.2 Windows x64
Sonarqube deployed with zip file
Trying to run sonar scanner but every time getting the following issue
“11:32:16.200 WARN Use of ‘sonar.login’ property has been deprecated in favor of ‘sonar.token’ (or the env variable alternative ‘SONAR_TOKEN’). Please use the latter when passing a token.”

Tried following things but no success.
->passing -Dsonar.token in CLI command
->sonar.token entry in sonar-scanner.properties configuration

Kindly help me in running my first analysis.
Thanks

Hi,

Welcome to the community!

This is just a warning. Analysis should proceed after this. What version of SonarQube Server are you using? Check your page footer if you’re not sure.

If you’re doing this and still seeing the warning, then it’s likely that sonar.login is specified elsewhere in the project. Do you have a sonar-project.properties file?

 
Ann

Hi,
Thanks Ann for the reply, I am using sonar sever Community Build-v25.1.0.102122, yes I have sonar-project.properties file and following are its details.

------sonar-project.properties---------------
# must be unique in a given SonarQube instance
sonar.projectKey=Sync_NAV

# --- optional properties ---

# defaults to project key
sonar.projectName=Sync_NAV
# defaults to 'not provided'
sonar.projectVersion=1.0
 
# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=SyncNavWS
 
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

Furthermore, I am getting the following error also.


ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Failed to extract archive
        at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:202)
        at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:147)
        at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:87)
        at org.sonarsource.scanner.lib.internal.facade.forked.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:54)
        at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:153)
        at org.sonarsource.scanner.cli.Main.analyze(Main.java:76)
        at org.sonarsource.scanner.cli.Main.main(Main.java:64)
Caused by: java.nio.file.AccessDeniedException: C:\Users\afzaal.rehman\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\jre8980325800540206491 -> C:\Users\afzaal.rehman\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\OpenJDK17U-jre_x64_windows_hotspot_17.0.13_11.zip_extracted
        at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.WindowsFileCopy.move(Unknown Source)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
        at java.base/java.nio.file.Files.move(Unknown Source)
        at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:196)
        ... 6 common frames omitted

Hi,

If it’s not in your properties file, it may be en an envvar.

Regarding your error, this looks like file permissions. Do you have antivirus running on the build agent. We advise against that for reasons like this.

 
HTH,
Ann

Hi,
Where to find envvar? Yes antivirus is running and looking into way around to avoid this issue.

Thanks.

Hi,

This SO answer should help.

 
Ann

Hi,
Issue resolved after calling the scanner service from correct base directory.