sonar maven插件无法下载文件:http:// localhost:9000 / deploy / jdbc-driver.jar

时间:2012-04-11 20:35:08

标签: maven-plugin sonarqube

我尝试下载并安装声纳,然后使用maven声纳插件运行分析。 我已经尝试了第一个Sonar版本2.14,现在是2.13.1,但我一遍又一遍地得到同样的错误。

似乎无法从localhost(声纳服务器)下载jdbc驱动程序,因为我收到此错误消息:“无法下载 文件:http://localhost:9000/deploy/jdbc-driver.jar(无代理):读取超时 - > [帮助1]“

但是如果我用我的浏览器转到http://localhost:9000/deploy/jdbc-driver.jar,它会毫无问题地下载文件,所以似乎声纳服务器正在以正确的方式工作,并且maven声纳插件做错了我可以不明白。

我也尝试将声纳的上下文根改为/声纳,但我得到了同样的错误。 我已经将sonar配置为使用postgreSQL而不是嵌入式Derby数据库,但仍然没有运气。从浏览器访问Sonar就像一个魅力,但我无法运行mvn声纳:声纳所以此时我的声纳安装很无用...... :(

以下是使用-e选项运行maven的堆栈跟踪:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project betterfarmer-engine: Can not execute Sonar: Fail to download the
file: http://localhost:9000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project betterfarmer-engi
ne: Can not execute Sonar
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
        at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
        at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: org.sonar.api.utils.SonarException: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no proxy)
        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:130)
        at org.sonar.batch.bootstrap.ArtifactDownloader.downloadJdbcDriver(ArtifactDownloader.java:58)
        at org.sonar.batch.bootstrap.JdbcDriverHolder.<init>(JdbcDriverHolder.java:43)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:147)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:319)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:274)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:341)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:689)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:638)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:663)
        at org.sonar.api.platform.ComponentContainer.getComponentByType(ComponentContainer.java:113)
        at org.sonar.batch.bootstrap.Module.getComponentByType(Module.java:131)
        at org.sonar.batch.bootstrap.BootstrapModule.configure(BootstrapModule.java:63)
        at org.sonar.batch.bootstrap.Module.init(Module.java:49)
        at org.sonar.batch.bootstrap.Module.init(Module.java:41)
        at org.sonar.batch.Batch.<init>(Batch.java:37)
        at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:143)
        at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:136)
        at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
        ... 23 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.net.www.MeteredStream.read(MeteredStream.java:134)
        at java.io.FilterInputStream.read(FilterInputStream.java:133)
        at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2959)
        at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2953)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1262)
        at org.apache.commons.io.IOUtils.copy(IOUtils.java:1236)
        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:125)
        ... 48 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

1 个答案:

答案 0 :(得分:0)

您的声纳可能未正确安装。

我建议先重新安装(在前一个文件夹中),并检查在启动新声纳之前没有指向上一个安装位置的env属性。