Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20555

Build fails when Sonar is enabled in Post Build action

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sonar-plugin

      Maven job fails to build when Sonar is turned on.

      Here is the log:
      [INFO] — maven-compiler-plugin:3.0:compile (default-compile) @ manage —
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 179 source files to /usr01/var/lib/jenkins/jobs/Mercury Manage Trunk (Nightly)/workspace/target/classes
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
      [INFO] 1 error
      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 6.484s
      [INFO] Finished at: Wed Nov 13 17:54:57 SGT 2013
      [INFO] Final Memory: 12M/212M
      [INFO] ------------------------------------------------------------------------

      Sonar plugin: 2.2.2
      Java JDK: 7u25

          [JENKINS-20555] Build fails when Sonar is enabled in Post Build action

          Chin Boon Oh created issue -
          Chin Boon Oh made changes -
          Description Original: Maven job fails to build when Sonar is turned on.

          Here is the log:
          [INFO] — maven-compiler-plugin:3.0:compile (default-compile) @ manage —
          [INFO] Changes detected - recompiling the module!
          [INFO] Compiling 179 source files to /usr01/var/lib/jenkins/jobs/Mercury Manage Trunk (Nightly)/workspace/target/classes
          [INFO] -------------------------------------------------------------
          [ERROR] COMPILATION ERROR :
          [INFO] -------------------------------------------------------------
          [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
          [INFO] 1 error
          [INFO] -------------------------------------------------------------
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD FAILURE
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 6.484s
          [INFO] Finished at: Wed Nov 13 17:54:57 SGT 2013
          [INFO] Final Memory: 12M/212M
          [INFO] ------------------------------------------------------------------------
          New: Maven job fails to build when Sonar is turned on.

          Here is the log:
          [INFO] — maven-compiler-plugin:3.0:compile (default-compile) @ manage —
          [INFO] Changes detected - recompiling the module!
          [INFO] Compiling 179 source files to /usr01/var/lib/jenkins/jobs/Mercury Manage Trunk (Nightly)/workspace/target/classes
          [INFO] -------------------------------------------------------------
          [ERROR] COMPILATION ERROR :
          [INFO] -------------------------------------------------------------
          [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
          [INFO] 1 error
          [INFO] -------------------------------------------------------------
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD FAILURE
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 6.484s
          [INFO] Finished at: Wed Nov 13 17:54:57 SGT 2013
          [INFO] Final Memory: 12M/212M
          [INFO] ------------------------------------------------------------------------

          Sonar plugin: 2.2.2
          Java JDK: 7u25

          Fernando Teles added a comment - - edited

          I had the same problem. To solve, try to configure JDK field in the Sonar Analysys Step and choose a literal JDK version, (don't use "Inherit From Job"), in my case it was jdk1.7.0_71. It worked for me.

          Fernando Teles added a comment - - edited I had the same problem. To solve, try to configure JDK field in the Sonar Analysys Step and choose a literal JDK version, ( don't use "Inherit From Job"), in my case it was jdk1.7.0_71. It worked for me.
          Fernando Teles made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 152080 ] New: JNJira + In-Review [ 194201 ]

            sonarteam Sonar Team
            chinboon Chin Boon Oh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: