2015-05-14 130 views
2

最近,當我嘗試分析的Android Studio代碼Analyze > Inspect Code)我總是得到這樣的錯誤:「拋出:IllegalArgumentException」在SonarQube社區插件

11:35:28 IllegalArgumentException: Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null 

在其他項目中正常工作。當用戶點擊鏈接IllegalArgumentException,該屏幕顯示:

IDE Fatal Error: Exception in SonarQube Community plugin

很顯然,我並不想禁用插件。

異常文本複製在這裏:

Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null 
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null 
    at org.intellij.sonar.persistence.SonarServers.get(SonarServers.java) 
    at org.intellij.sonar.analysis.DownloadIssuesTask.from(DownloadIssuesTask.java:53) 
    at org.intellij.sonar.analysis.SonarQubeInspectionContext.performPreRunActivities(SonarQubeInspectionContext.java:143) 
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase.initializeTools(GlobalInspectionContextBase.java:340) 
    at com.intellij.codeInspection.ex.GlobalInspectionContextImpl.runTools(GlobalInspectionContextImpl.java:339) 
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase$6.run(GlobalInspectionContextBase.java:283) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:449) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402) 
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54) 
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase.performInspectionsWithProgress(GlobalInspectionContextBase.java:280) 
    at com.intellij.codeInspection.ex.GlobalInspectionContextBase$4.run(GlobalInspectionContextBase.java:241) 
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563) 
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402) 
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137) 
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126) 
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56) 

任何人都經歷了這個問題?問題在哪裏,我能做些什麼來解決它?

回答

2

您應該配置一個SonarQube服務器從插件庫爲每README使用:

After the installation, you first of all need to configure the connection to your Sonar server. This is done per project and/ or module. You can use a remote server or a local one on your machine.

In your IDE go to Preferences -> SonarQube.

In your IDE go to Preferences -> SonarQube

Click Add, enter the address of your Sonar server and the credentials (if needed) and click OK.

enter image description here

+0

謝謝@NikitaBaksalyar。我配置它並在幾天前創建了服務器,但不知何故服務器已設置。我只需要選擇正確的服務器。 – frapen

1

此錯誤,也可以在您創建的項目設置服務器,但不是在全局設置拋出。您還必須選擇&在全局設置中添加服務器。

相關問題