Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1966

Clover Maven Plugin adds "clover" classifier for directory-based artifacts

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Low Low
    • open-source
    • None
    • None
    • None
    • Severity 3 - Minor

      Problem

      Clover Maven Plugin replaces list of artifacts and artifacts dependencies by using an artifact with the "clover" classifier if any such exists.

      This is useful for "clover:instrument" goal and multi-module Maven builds, because this way instrumented module can use instrumented dependencies (instead of normal ones).

      However, a build can have an artifact being a '/target/classes' folder (for a current module compiled). Maven's artifact resolver resolves such directory to be an artifact with a "clover" classifier too. Example:

      As Clover "sees" such artifact as resolved, it replaces it by the "clover" one, despite the fact that this is the same location.

      This is superfluous.

      In a normal build it works fine, but it fails when aspectj-maven-plugin is used together with clover-maven-plugin. See:

      Possible fixes

      • do not add "clover" classifier to artifacts in the same location
      • do not swizzle artifacts in clover:setup
      • do not swizzle artifacts if useCloverClassifier=false (extend usage of this property)

      Workaround

      Set cloveredArtifactExpiryInMillis=-1. This will trick Clover to see all 'clover' artifacts as outdated. Warning in logs is produced:

      [WARNING] Using [<artifact>], built on <date> even though a Clovered version exists but it's older (lastModified: <date> ) and could fail the build. Please consider running Clover again on that dependency's project.

      • note that setting useCloverClassifier=false does not help (this is for output artifacts, not dependencies)
      • note that changing "clover:instrument" to "clover:setup" does not help

            [CLOV-1966] Clover Maven Plugin adds "clover" classifier for directory-based artifacts

            Michael Andreacchio made changes -
            Resolution New: Won't Fix [ 2 ]
            Status Original: Open [ 1 ] New: Closed [ 6 ]
            Marek Parfianowicz made changes -
            Fix Version/s New: open-source [ 56395 ]
            Marek Parfianowicz made changes -
            Comment [ A comment with security level 'jira-users' was removed. ]
            Marek Parfianowicz made changes -
            Comment [ A comment with security level 'jira-users' was removed. ]
            jonah (Inactive) made changes -
            Symptom Severity New: Minor [ 14432 ]
            Marek Parfianowicz made changes -
            Workflow Original: New Clover Workflow [ 1589825 ] New: New Clover Workflow - Restricted [ 1589826 ]
            Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]
            Marek Parfianowicz made changes -
            Description New: *Problem*

            Clover Maven Plugin replaces list of artifacts and artifacts dependencies by using an artifact with the "clover" classifier if any such exists.

            This is useful for "clover:instrument" goal and multi-module Maven builds, because this way instrumented module can use instrumented dependencies (instead of normal ones).

            However, a build can have an artifact being a '/target/classes' folder (for a current module compiled). Maven's artifact resolver resolves such directory to be an artifact with a "clover" classifier too. Example:

             !aspectproject-normal-jar.png|thumbnail!

             !aspectproject-clover-jar.png|thumbnail!

            As Clover "sees" such artifact as resolved, it replaces it by the "clover" one, despite the fact that this is the same location.

            This is superfluous.

            In a normal build it works fine, but it fails when aspectj-maven-plugin is used together with clover-maven-plugin. See:
             * https://answers.atlassian.com/questions/39984820
             * CLV-6357 ticket

            *Possible fixes*
             * do not add "clover" classifier to artifacts in the same location
             * do not swizzle artifacts in clover:setup
             * do not swizzle artifacts if useCloverClassifier=false (extend usage of this property)

            *Workaround*

            Set cloveredArtifactExpiryInMillis=-1. This will trick Clover to see all 'clover' artifacts as outdated. Warning in logs is produced:

            {quote}
            [WARNING] Using [<artifact>], built on <date> even though a Clovered version exists but it's older (lastModified: <date> ) and could fail the build. Please consider running Clover again on that dependency's project.
            {quote}

             * note that setting useCloverClassifier=false does not help (this is for output artifacts, not dependencies)
             * note that changing "clover:instrument" to "clover:setup" does not help
            Marek Parfianowicz made changes -
            Attachment New: aspectproject-clover-jar.png [ 209866 ]
            Attachment New: aspectproject-normal-jar.png [ 209867 ]
            Marek Parfianowicz created issue -

              Unassigned Unassigned
              mparfianowicz Marek Parfianowicz
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: