Dev - Nexus
  1. Dev - Nexus
  2. NEXUS-1333

Incorrect snapshot timestamps in maven-metadata.xml

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0.2
    • Fix Version/s: 1.4 Iteration 9/14
    • Component/s: None
    • Labels:
      None
    • Environment:
      Solaris 10
    • Global Rank:
      4724

      Description

      (This may be related to NEXUS-1332 as it is on an artifact affected by it)

      (Artifact names changed to protect the innocent)

      groupId: group.id
      artifactId: artifactID.$

      {target}
      version: 14.0.0-SNAPSHOT
      Artifact was deployed with target=main, so we are looking at directory group/id/artifactID.main/14.0.0-SNAPSHOT

      The most recent build in this directory is:
      artifactID.main-14.0.0-20090106.195709-143.zip

      maven-metadata.xml generated by Rebuild Maven Metadata within this directory reads:
      <metadata>
      <groupId>group.id</groupId>
      <artifactId>artifactID.${target}

      </artifactId> (I believe this should read artifactID.main instead, see NEXUS-1332)
      <version>14.0.0-SNAPSHOT</version>
      <versioning>
      <snapshot>
      <timestamp>6.195709</timestamp> (should read 20090106.195709)
      <buildNumber>143</buildNumber>
      </snapshot>
      <lastUpdated>20090107162705</lastUpdated> (this matches when I last ran Rebuild Maven Metadata in GMT)
      </versioning>
      </metadata>

      This causes the Maven client to go looking for http://mynexusURL/groups/mygroupname/group/id/artifactID.main/14.0.0-SNAPSHOT/artifactID.main-14.0.0-6.195709-143.zip which doesn't exist (6. should be 20090106. instead) and fail.

        Activity

        Hide
        Brian Fox added a comment -

        in general, getting artifacts deployed into the repo with indeterministic gav values is a bad thing. We'll fix this, but generally this should be avoided in your poms.

        Show
        Brian Fox added a comment - in general, getting artifacts deployed into the repo with indeterministic gav values is a bad thing. We'll fix this, but generally this should be avoided in your poms.
        Hide
        Arnaud Heritier added a comment -

        I have a similar issue with a project which deployed a pom with the following content :

        <?xml version="1.0" encoding="UTF-8"?>
        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                <modelVersion>4.0.0</modelVersion>
                <parent>
                        <artifactId>project-parent</artifactId>
                        <groupId>fr.company.project</groupId>
                         <version>5.1.12-SNAPSHOT</version>
                </parent>
                <groupId>${parent.groupId}</groupId>
                <artifactId>rps-services-client</artifactId>
                <name>Generali :: ${artifactId} ${packaging}</name>
                <version>5.1.12-SNAPSHOT</version>
        ...
        </project>
        

        If I remove the <groupId>$

        {parent.groupId}

        </groupId>, Nexus successfully rebuild metadata.

        Show
        Arnaud Heritier added a comment - I have a similar issue with a project which deployed a pom with the following content : <?xml version= "1.0" encoding= "UTF-8" ?> <project xmlns= "http: //maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" > <modelVersion>4.0.0</modelVersion> <parent> <artifactId>project-parent</artifactId> <groupId>fr.company.project</groupId> <version>5.1.12-SNAPSHOT</version> </parent> <groupId>${parent.groupId}</groupId> <artifactId>rps-services-client</artifactId> <name>Generali :: ${artifactId} ${packaging}</name> <version>5.1.12-SNAPSHOT</version> ... </project> If I remove the <groupId>$ {parent.groupId} </groupId>, Nexus successfully rebuild metadata.
        Hide
        Brian Demers added a comment -

        depends on pom interpolation

        Show
        Brian Demers added a comment - depends on pom interpolation
        Hide
        Juven Xu added a comment -

        it was already fixed, when the metadata rebuilder meets pom property reference, it will switch to use the artifact path to calculate the GAV to build maven-metadata.xml

        Verified the metadata is correct

        Show
        Juven Xu added a comment - it was already fixed, when the metadata rebuilder meets pom property reference, it will switch to use the artifact path to calculate the GAV to build maven-metadata.xml Verified the metadata is correct
        Hide
        Rich Seddon added a comment -

        verified in Nexus OSS svn #5027, the maven metadata no longer contains uninterpolated values for either of these cases.

        Show
        Rich Seddon added a comment - verified in Nexus OSS svn #5027, the maven metadata no longer contains uninterpolated values for either of these cases.

          People

          • Assignee:
            Rich Seddon
            Reporter:
            Deleted User
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 50m
              50m