- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用的是 Jenkins 版本 2.7.1,目前与 Sonar 对话时遇到问题。我们的企业 Sonar 目前版本为 4.5.4,我们不允许更改此版本在 Jenkins 中我使用 Maven 3.3.9
我收到的错误如下
05:49:46 [INFO] SonarQube version: 4.5.4
05:49:48 [INFO] Default locale: "en_US", source code encoding: "UTF-8"
05:49:49 [INFO] [05:49:49.050] Load global referentials...
05:49:49 [INFO] [05:49:49.185] Load global referentials done: 138 ms
05:49:49 [INFO] ------------------------------------------------------------------------
05:49:49 [INFO] BUILD FAILURE
05:49:49 [INFO] ------------------------------------------------------------------------
05:49:49 [INFO] Total time: 6.069 s
05:49:49 [INFO] Finished at: 2016-07-20T05:49:49-04:00
05:49:49 [INFO] Final Memory: 23M/237M
05:49:49 [INFO] ------------------------------------------------------------------------
05:49:49 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project services-web: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 -> [Help 1]
05:49:49 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project services-web: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
05:49:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
05:49:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
05:49:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
05:49:49 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
05:49:49 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
05:49:49 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
05:49:49 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
05:49:49 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
05:49:49 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
05:49:49 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
05:49:49 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
05:49:49 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
05:49:49 at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
05:49:49 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
05:49:49 at java.lang.reflect.Method.invoke(Method.java:497)
05:49:49 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
05:49:49 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
05:49:49 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
05:49:49 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
05:49:49 Caused by: org.apache.maven.plugin.MojoExecutionException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
05:49:49 at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
05:49:49 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
05:49:49 at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
05:49:49 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
05:49:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
05:49:49 ... 20 more
05:49:49 Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
05:49:49 at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
05:49:49 at com.google.gson.Gson.fromJson(Gson.java:803)
05:49:49 at com.google.gson.Gson.fromJson(Gson.java:768)
05:49:49 at com.google.gson.Gson.fromJson(Gson.java:717)
05:49:49 at com.google.gson.Gson.fromJson(Gson.java:689)
05:49:49 at org.sonar.batch.protocol.input.GlobalReferentials.fromJson(GlobalReferentials.java:70)
05:49:49 at org.sonar.batch.referential.DefaultGlobalReferentialsLoader.load(DefaultGlobalReferentialsLoader.java:37)
05:49:49 at org.sonar.batch.referential.GlobalReferentialsProvider.provide(GlobalReferentialsProvider.java:38)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
05:49:49 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
05:49:49 at java.lang.reflect.Method.invoke(Method.java:497)
05:49:49 at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
05:49:49 at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
05:49:49 at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
05:49:49 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
05:49:49 at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
05:49:49 at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
05:49:49 at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
05:49:49 at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
05:49:49 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
05:49:49 at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
05:49:49 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
05:49:49 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
05:49:49 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
05:49:49 at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
05:49:49 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
05:49:49 at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
05:49:49 at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
05:49:49 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
05:49:49 at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
05:49:49 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
05:49:49 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
05:49:49 at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
05:49:49 at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
05:49:49 at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
05:49:49 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
05:49:49 at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
05:49:49 at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
05:49:49 at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
05:49:49 at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
05:49:49 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
05:49:49 at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
05:49:49 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
05:49:49 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
05:49:49 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
05:49:49 at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
05:49:49 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
05:49:49 at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
05:49:49 at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
05:49:49 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
05:49:49 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
05:49:49 at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
05:49:49 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
05:49:49 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
05:49:49 at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
05:49:49 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
05:49:49 at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
05:49:49 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
05:49:49 at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
05:49:49 at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
05:49:49 at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1033)
05:49:49 at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1025)
05:49:49 at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
05:49:49 at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
05:49:49 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
05:49:49 at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)
05:49:49 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
05:49:49 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:70)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
05:49:49 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
05:49:49 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
05:49:49 at java.lang.reflect.Method.invoke(Method.java:497)
05:49:49 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
05:49:49 at com.sun.proxy.$Proxy23.executeOldVersion(Unknown Source)
05:49:49 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:245)
05:49:49 at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
05:49:49 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
05:49:49 ... 23 more
05:49:49 Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
05:49:49 at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
05:49:49 at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
05:49:49 ... 112 more
问题:有谁知道我需要更改什么才能使其正常工作?
仅供引用 - 我在没有 jenkins 的情况下在本地尝试了此操作 - 只是运行 maven 命令并得到了相同的错误。
最佳答案
由于正确追踪此问题所需的详细信息超出了您通过问题描述实际提供的信息,因此以下是一些可能的故障排除路径:
降级 Sonar Maven 插件:尽管 official documentation指出:
From maven-sonar-plugin 2.7, SonarQube < 4.5 is no longer supported. If using SonarQube instance prior to 4.5, you should use maven-sonar-plugin 2.6.
因此,您当前使用的插件确实应该支持版本 4.5.4 (org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2
),这可能是兼容性边缘情况,因此值得尝试早期版本。但请注意,早期的主要版本的 groupId 有不同的 Maven 协调(GAV、GroupId、ArtifactId、Version):org.codehaus.mojo:sonar-maven-plugin:jar:2.7.1
检查代理设置:reported 已经出现了一个非常相似的错误(几乎相同的堆栈跟踪)。 (未经证实的)结论是:
the error ... means that the response is probably corrupted by your proxy.
Please compare original response (without using your proxy) and the one you get from the proxy.
关于 Jenkins 与 Sonar 集成不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38477873/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!