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

          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 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.

          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 .

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/maven/reporters/MavenArtifact.java
          src/main/java/hudson/maven/reporters/MavenArtifactRecord.java
          http://jenkins-ci.org/commit/maven-plugin/2320cc985b27abab948fff971be5813ad2bca5f8
          Log:
          JENKINS-11814 JENKINS-20487 Cleaning up dead code now that MavenArtifactArchiver does not call recordFingerprints.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/maven/reporters/MavenArtifact.java src/main/java/hudson/maven/reporters/MavenArtifactRecord.java http://jenkins-ci.org/commit/maven-plugin/2320cc985b27abab948fff971be5813ad2bca5f8 Log: JENKINS-11814 JENKINS-20487 Cleaning up dead code now that MavenArtifactArchiver does not call recordFingerprints.

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

              Created:
              Updated:
              Resolved: