SonarQube: Swift plugin issue

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension) :
    SonarQube: tested with 7.7,8.1
    Swift Plugin: sonar-swift-plugin-4.2.2.77
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    java.lang.IllegalStateException: Fail to load plugin SonarSwift [swift]

we are trying to install swift plugin in Sonarqube, but it was failing with below reasons:

java.lang.IllegalStateException: Fail to load plugin SonarSwift [swift]
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:88)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:557)
at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:213)
at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:187)
at org.sonar.server.platform.PlatformImpl.access$500(PlatformImpl.java:46)
at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$0(PlatformImpl.java:120)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:370)
at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:120)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:354)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: com/sonarsource/plugins/license/api/LicensedPluginRegistration
at com.sonar.swift.plugin.SwiftPlugin.define(Unknown Source)
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:78)
… 9 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.sonarsource.plugins.license.api.LicensedPluginRegistration
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
… 11 common frames omitted
2020.01.28 17:26:22 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process
2020.01.28 17:26:23 INFO web[o.s.s.p.d.EmbeddedDatabase] Embedded database stopped

please help us on this issue.

Hi,

Would you be using a Community Edition ?
(SonarSwift requires at least a Developper edition, see https://www.sonarsource.com/products/codeanalyzers/sonarswift.html)

Oh is it, We are using CE. if we want it on Community Edition, is there any process? any third party plugins?

Hi,

There is https://github.com/Backelite/sonar-swift (and next time just feel free to google “sonarqube swift” or something like this, usually it works nicely)

I already using this plugin, but its not collecting any results. Its shows all metrics as zero.

We can’t help you with that here. Provide your feedback to that plugin.