1

C# プロジェクトの Jenkins ビルドの最後に実行するように Sonar を構成しました。ログは、Sonar が分析を最後まで実行したことを示していますが、ビルドは何らかのクリーンアップ ステップで失敗しています。また、存在しない pom.xml も探しています。mvn.bat が Sonar のスタンドアロン バージョンで実行しようとしている理由と、これをオフにして正常に実行する方法を教えてください。どうもありがとう。

16:02:28.256 INFO  .b.p.UpdateStatusJob - ANALYSIS SUCCESSFUL, you can browse http://sonarserver:9000
16:02:28.256 INFO  b.p.PostJobsExecutor - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
16:02:28.288 INFO  b.p.PostJobsExecutor - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
16:02:28.303 INFO  .p.d.p.KeepOneFilter - -> Keep one snapshot per day between 2012-07-27 and 2012-08-23
16:02:28.303 INFO  .p.d.p.KeepOneFilter - -> Keep one snapshot per week between 2011-08-26 and 2012-07-27
16:02:28.303 INFO  .p.d.p.KeepOneFilter - -> Keep one snapshot per month between 2007-08-31 and 2011-08-26
16:02:28.303 INFO  .d.p.DeleteAllFilter - -> Delete data prior to: 2007-08-31
16:02:28.303 INFO  o.s.c.purge.PurgeDao - -> Clean MyProject:MyProjectDevelopment [id=1]
16:02:28.319 INFO  o.s.c.purge.PurgeDao - <- Clean snapshot 3727
16:02:29.647 INFO  o.s.c.purge.PurgeDao - -> Clean MyProject.Library [id=2]
16:02:29.663 INFO  o.s.c.purge.PurgeDao - -> Clean MyProject.Web [id=3]
16:02:29.663 INFO  o.s.c.purge.PurgeDao - -> Clean MyProjectOmnitureDownloader [id=4]
Total time: 1:04.065s
Final Memory: 4M/26M
[workspace] $ mvn.bat -f "H:\jobs\MyProject\workspace\pom.xml" -e -B sonar:sonar -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://sonarserver:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" ******** ******** -Dsonar.host.url=http://sonarserver:9000 -Dsonar.language=cs
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn.bat" (in directory "H:\jobs\MyProject\workspace"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.Launcher$ProcStarter.join(Launcher.java:345)
    at hudson.tasks.Maven.perform(Maven.java:263)
    at hudson.plugins.sonar.utils.SonarMaven.executeMaven(SonarMaven.java:138)
    at hudson.plugins.sonar.SonarPublisher.executeSonar(SonarPublisher.java:300)
    at hudson.plugins.sonar.SonarPublisher.perform(SonarPublisher.java:261)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685)
    at hudson.model.Build$RunnerImpl.post2(Build.java:162)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:632)
    at hudson.model.Run.run(Run.java:1463)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:239)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    ... 19 more
Sonar analysis completed: FAILURE
Build step 'Sonar' changed build result to FAILURE
Build step 'Sonar' marked build as failure
Sending e-mails to: me@myproject.com
Finished: FAILURE
4

1 に答える 1

0

Sonar Jenkins プラグインをインストールして、ビルドで有効にしましたか?

Jenkins プラグインは、Maven を使用して Sonar 分析を起動します。これはジョブの最後に実行されるため、クリーンアップ ステップのように見えるかもしれません。

于 2012-08-26T21:21:31.390 に答える