当前位置: 首页 > 知识库问答 >
问题:

声纳maven插件下载文件失败:http://localhost:9000/deploy/jdbc-driver.jar

田普松
2023-03-14

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

它似乎无法下载jdbc驱动程序从localhost(声纳服务器),因为我得到这个错误消息:失败下载文件:http://localhost:9000/deploy/jdbc-driver.jar(没有代理):读取超时-

但是如果我去http://localhost:9000/deploy/jdbc-司机。jar与我的浏览器,它下载的文件没有问题,所以似乎声纳服务器的工作方式是正确的,而maven声纳插件正在做一些错误,我无法找出。

我也试图改变声纳的上下文根 /sonar,但我得到同样的错误。我已经配置声纳使用postgreSQL而不是嵌入式Derby数据库,但仍然没有运气。从浏览器访问声纳工作就像一个魅力,但我不能运行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个答案

陈毅
2023-03-14

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

  • 服务器日志中没有错误吗?
  • 您是否可以在http://localhost:9000?浏览Web应用程序

我建议从新安装开始(在上一个文件夹之外的另一个文件夹中),并在启动新Sonar之前检查您没有指向上一个安装位置的env属性。

 类似资料:
  • 我正在使用sonar maven插件触发java代码分析。 声纳转轮卡住了一个java文件处理。控制台上的最后一条消息读取JavaAST扫描和进程卡在... SonarQube版本:7.3.0 Sonar maven插件版本:3.6。0.1398(最新版本),但已尝试使用3.4。1.1168也是如此 日志如下所示: OOM异常堆栈跟踪: 几个小时后,它会抛出内存不足异常 顺便说一下,这个代表了po

  • 我是的长期用户,如果单元测试失败,它将不会发布(也就是将JAR部署到maven repo)。 出于各种原因,我只想使用maven deploy插件,但显然,即使中存在测试失败,我仍将部署该插件。 结果而不只是 编辑它似乎是詹金斯的问题..不能繁殖 我不确定Jenkins为什么或如何强制maven构建在测试失败时继续(我假设这是为了报告),但它没有显示为使其继续而传递的任何选项。这似乎只有当詹金斯说

  • 我试图释放,但失败了 MVN发布:执行 错误是 部署失败:未在POM inside distributionManagement元素或-DaltDeploymentRepository=id::layout::url参数中指定repository元素 pom。xml 我不明白这个问题。通过部署插件部署到快照存储库工作正常

  • Sonar和Jenkins位于同一台机器上,Sonar分析在Jenkins作业发布步骤中运行。詹金斯的工作是用Maven 3.0.5构建的。 一切都很好,直到我们从4.5更新了声纳。从昨天的x到5.1.2。 更新sonar后,步骤失败,出现异常: org.apache.maven.lifecycle.生命周期执行异常:未能执行目标org.codehaus.mojo: sonar-maven-plu

  • 问题内容: 我正在与詹金斯使用声纳插件。它总是产生此错误。看来插件找不到JDBC驱动程序。我尝试根据我在google中找到的许多解决方案将JDBC驱动程序放在许多可能的位置,但是它仍然会产生此错误。 问题答案: 我发现了问题。它在sonar / conf / sonar.properties文件中(在sonarqube安装文件夹中)。数据库的默认URL错误。我为mysql更正了它。现在工作正常。我