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

Maven artifact fingerprints are computed and recorded twice

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • maven-plugin
    • None

      The artifacts which are produced by a maven job have their artifacts fingerprinted twice. Once in MavenFingerprinter and once in MavenArtifactArchiver . This adds unnecessary overhead to maven jobs.

      Proposal: as fingerprints are needed in the MavenArtifact records generated in the MavenArtifactArchiver, it probably doesn't make much sense to remove the fingerprinting from there. Instead, I'd propose to fingerprint all 'used' artifacts in the MavenFingerprinter and all 'produced' artifacts in the MavenArtifactArchiver

      *) Note that fingerprints are even generated in MavenArtifactArchiver if automatic artifact archiving is disabled

          [JENKINS-11814] Maven artifact fingerprints are computed and recorded twice

          kutzi created issue -

          I'm seeing a huge difference between a maven build using a freestyle job and maven job (taking twice the time). It seems that it might be related to fingerprints.
          I guess I could try to build the maven plugin locally with https://github.com/jenkinsci/jenkins/blob/master/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java line 147 removed.

          youri bonnaffe added a comment - I'm seeing a huge difference between a maven build using a freestyle job and maven job (taking twice the time). It seems that it might be related to fingerprints. I guess I could try to build the maven plugin locally with https://github.com/jenkinsci/jenkins/blob/master/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java line 147 removed.
          kutzi made changes -
          Assignee New: kutzi [ kutzi ]

          kutzi added a comment -

          Okay, I'll try to create a pull request based on my proposal.

          kutzi added a comment - Okay, I'll try to create a pull request based on my proposal.

          I've tried with the line mar.recordFingerprints(); commented but I see no difference in build time.
          From MavenFingerPrinter it seems that fingerprinting is required to keep track of dependencies so maybe it is necessary to launch others build when snapshot dependencies change or to use only build changed modules option.
          Note that the I use maven jobs with automatic artifact archiving disabled.

          youri bonnaffe added a comment - I've tried with the line mar.recordFingerprints(); commented but I see no difference in build time. From MavenFingerPrinter it seems that fingerprinting is required to keep track of dependencies so maybe it is necessary to launch others build when snapshot dependencies change or to use only build changed modules option. Note that the I use maven jobs with automatic artifact archiving disabled.

          kutzi added a comment -

          There are other reasons why a Maven job might be slower than a freestyle job. You might want to try the Timestamper plugin to get a clue where the time is spent.

          kutzi added a comment - There are other reasons why a Maven job might be slower than a freestyle job. You might want to try the Timestamper plugin to get a clue where the time is spent.
          kutzi made changes -
          Link New: This issue is related to JENKINS-16301 [ JENKINS-16301 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-11333 [ JENKINS-11333 ]

          Jesse Glick added a comment -

          It looks like this was quietly fixed as part of the fix of JENKINS-20487.

          Jesse Glick added a comment - It looks like this was quietly fixed as part of the fix of JENKINS-20487 .
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-20487 [ JENKINS-20487 ]

            kutzi kutzi
            kutzi kutzi
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: