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

Timestamps are not added to module logs in Maven jobs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      Fedora 25 x86_64, Java 1.8.0_112, Jenkins 2.89.3 (from RPM), SSH slaves, Maven Plugin 3.1, Timestamper 1.8.9
    • Similar Issues:

      Description

      "Build Environment ยป Add timestamps to the Console Output" doesn't have any effect on the console output in a Maven-based project. (They are added to freestyle projects; I don't have any other types.) It appears to be possible to add them with a pipeline (JENKINS-30142) but I'd prefer the config option to work.

        Attachments

          Activity

          Hide
          stevengbrown Steven G Brown added a comment -

          Hi Peter,

          I'm sorry you've run into difficulties. I gave it a go myself, with the same versions of Jenkins, Maven Plugin and Timestamper, and it worked for me. Could you check a few things to help me track down the problem?

          On the Jenkins master, open the directory for the build. You should see a build.xml, log and also a timestamper directory containing the timestamps. If not, it means that the timestamps weren't recorded.

          You should see this on the left hand side of the page. Make sure you have "System clock time" or "Elapsed time" selected and not "None". While you have this page open, please also check the browser console for warnings.

          Cheers
          Steve

          Show
          stevengbrown Steven G Brown added a comment - Hi Peter, I'm sorry you've run into difficulties. I gave it a go myself, with the same versions of Jenkins, Maven Plugin and Timestamper, and it worked for me. Could you check a few things to help me track down the problem? On the Jenkins master, open the directory for the build. You should see a build.xml , log and also a timestamper directory containing the timestamps. If not, it means that the timestamps weren't recorded. You should see this on the left hand side of the page. Make sure you have "System clock time" or "Elapsed time" selected and not "None". While you have this page open, please also check the browser console for warnings. Cheers Steve
          Hide
          peterj Peter Janes added a comment -

          I do see a timestamper directory, with a 32-byte timestamps file and a 41-byte timestamps.SHA-1 file. However, in the console output for the job I don't have a `Timestamps` block. Not sure what's up.

          Show
          peterj Peter Janes added a comment - I do see a timestamper directory, with a 32-byte timestamps file and a 41-byte timestamps.SHA-1 file. However, in the console output for the job I don't have a `Timestamps` block. Not sure what's up.
          Hide
          peterj Peter Janes added a comment -

          Oh! I see the issue: the job is configured to build modules in parallel, and it's the module logs that don't have timestamps. The parent build does have the `Timestamps` config block, and I see timestamps in the output, but they show that the build (of the parent) is "complete" in just a few seconds, even though the child jobs take much longer to run.

          10:26:35 Started by user Peter Janes
          10:26:35 [EnvInject] - Loading node environment variables.
          10:26:35 Building remotely on build14 (x86_64 fedora25) in workspace /home/jenkins/workspace/test-project
          ...
          10:26:42 Triggering test:test
          10:26:42 Sending e-mails to: [my email]
          10:26:42 Finished: SUCCESS
          
          Show
          peterj Peter Janes added a comment - Oh! I see the issue: the job is configured to build modules in parallel, and it's the module logs that don't have timestamps. The parent build does have the `Timestamps` config block, and I see timestamps in the output, but they show that the build (of the parent) is "complete" in just a few seconds, even though the child jobs take much longer to run. 10:26:35 Started by user Peter Janes 10:26:35 [EnvInject] - Loading node environment variables. 10:26:35 Building remotely on build14 (x86_64 fedora25) in workspace /home/jenkins/workspace/test-project ... 10:26:42 Triggering test:test 10:26:42 Sending e-mails to: [my email] 10:26:42 Finished: SUCCESS
          Hide
          stevengbrown Steven G Brown added a comment -

          Thanks for investigating further Peter Janes. I was able to reproduce it too by using the parallel builds.

          I've submitted a fix for the Maven plugin.
          https://github.com/jenkinsci/maven-plugin/pull/114

          Show
          stevengbrown Steven G Brown added a comment - Thanks for investigating further Peter Janes . I was able to reproduce it too by using the parallel builds. I've submitted a fix for the Maven plugin. https://github.com/jenkinsci/maven-plugin/pull/114

            People

            • Assignee:
              stevengbrown Steven G Brown
              Reporter:
              peterj Peter Janes
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: