2016-07-20 10 views
3

私はJenkinsのバージョン2.7.1を使用していますが、現在Sonarと話しているときに問題が発生しています。 当社の企業ソナーは、バージョン4.5.4で、現在であり、我々は、変更は許可されていません、私はMavenの3.3.9JenkinsとSonarの統合がうまくいかない

を使用していますジェンキンスはこの

 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 
を次のように私は取得していますエラーがあります

質問:誰でも私がこの作業をするために変更する必要があることを知っていますか?

FYIと同じように、私はジェンキンなしでローカルで試してみました。ちょうどmavenコマンドを実行していて、同じエラーが発生しました。ここ

+1

そのスタックトレースに「起因」がありますか?もしそうなら、あなたは質問にそれを編集するべきです –

+0

はいです - 私はちょうど質問を更新しました – Damien

答えて

2

適切にこの問題を追跡するために細部の要求レベルは、あなたが実際にあなたの質問の説明を経由して提供できるものを超えているためには、いくつかの可能なトラブルシューティングのパスです:

  • ダウングレードソナーMavenプラグインofficial documentation状態であるが、その:mavenの-ソナー・プラグイン2.7から

    、SonarQube < 4.5はサポートされなくなりました。 4.5より前のSonarQubeインスタンスを使用する場合は、maven-sonar-plugin 2.6を使用する必要があります。

    となり、バージョン4.5.4 は確かにあなたが現在(org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2)を使用しているプラ​​グインによってサポートされる必要があり、それは互換性のエッジケースであるので、以前のバージョンを試してみる価値があるかもしれません。 org.codehaus.mojo:sonar-maven-plugin:jar:2.7.1

  • チェックプロキシ設定:以前のメジャーバージョンは、そののgroupIdのために異なるMavenのコーディネート(GAV、グループID、成果物、版)持っていたことに注意してください本当に同様のエラー(ほとんど同じスタックトレース)は、すでにreportedとされています(確認されていない)結論は:

    エラーは、おそらく応答があなたのプロキシによって壊れている可能性があることを意味します。

    元の応答(プロキシを使用せずに)とプロキシから取得した応答を比較してください。

関連する問題