Dev - Nexus
  1. Dev - Nexus
  2. NEXUS-4534

UniqueVersion doesnt support while depolying artifact in nexus repository

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.9.2
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None
    • Environment:
      Windows7,Nexus1.9.2
    • Global Rank:
      465

      Description

      I have Like this in my Pom.xml

      <distributionManagement>
      <repository>
      <id>deployment</id>
      <name>Deployment</name>
      <url>http://localhost:8080/nexus-webapp-1.9.2/content/repositories/snapshots/</url>
      <uniqueVersion>false</uniqueVersion>
      </repository>
      </distributionManagement>

      when deploy this is in snapshot repository each time the version of jar is getting changed with suffix of current time.
      for example my jar name exactly looking like this.

      "Sample-0.0.1-20110908.105729-7"

      I dont want the suffix 20110908.105729-7 in jar but instead i need snapshot.

      i tried uniqueVersion tag in maven...but it doesnt seems to work.
      can anyone exactly figure it out how to change this?

        Activity

        Hide
        Rich Seddon added a comment -

        The filename is created by maven, not Nexus.

        I'm assuming you are using Maven 3 here? uniqueVersion was deprecated in Maven 2, and removed in Maven 3. So the tag is ignored.

        https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-NonuniqueSnapshotDeployments

        Show
        Rich Seddon added a comment - The filename is created by maven, not Nexus. I'm assuming you are using Maven 3 here? uniqueVersion was deprecated in Maven 2, and removed in Maven 3. So the tag is ignored. https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-NonuniqueSnapshotDeployments
        Hide
        Dinesh PS added a comment -

        Then suggest me one solution to overcome this problem.

        Show
        Dinesh PS added a comment - Then suggest me one solution to overcome this problem.
        Hide
        Rich Seddon added a comment -

        It's not recommended to use non-unique snapshots since they lead to non-reproducible builds. The main use case for these was to save disk space in the repository, but this is best handled by scheduling a periodic snapshot removal task to keep the number of versions down.

        If you can tell us why you are using non-unique snapshots then we might be able to suggest an alternative solution.

        But if you really need to deploy non-unique snapshots then you will have to use Maven 2 to do the deploy, Maven 3 doesn't have support for this. And as I mentioned before, this is not a Nexus issue, deploys are just an HTTP PUT of an artifact, the filename is determined by the client (in this case Maven).

        Show
        Rich Seddon added a comment - It's not recommended to use non-unique snapshots since they lead to non-reproducible builds. The main use case for these was to save disk space in the repository, but this is best handled by scheduling a periodic snapshot removal task to keep the number of versions down. If you can tell us why you are using non-unique snapshots then we might be able to suggest an alternative solution. But if you really need to deploy non-unique snapshots then you will have to use Maven 2 to do the deploy, Maven 3 doesn't have support for this. And as I mentioned before, this is not a Nexus issue, deploys are just an HTTP PUT of an artifact, the filename is determined by the client (in this case Maven).
        Hide
        Dinesh PS added a comment -

        ok thank you

        Show
        Dinesh PS added a comment - ok thank you
        Hide
        Peter Lawrey added a comment - - edited

        The problem we are seeing is that Fuse 6.0.0 picks a ?random? SNAPSHOT build, sometimes the latest, sometimes something older than the last time it updated the bundle.

        While uniqueSnapshots might make builds more reproducable, our deployments are quite random and we have to check the manifest of the jar we download to check which version we got. Since we don't want anything but the latest SNAPSHOT this causes real confusion and headaches, for no advnatage.

        I don't believe rolling back to maven 2.x is an option, is there any other solution?

        Can we make nexus only keep the last version?

        Would re-deploying a release version workaround this problem

        Show
        Peter Lawrey added a comment - - edited The problem we are seeing is that Fuse 6.0.0 picks a ?random? SNAPSHOT build, sometimes the latest, sometimes something older than the last time it updated the bundle. While uniqueSnapshots might make builds more reproducable, our deployments are quite random and we have to check the manifest of the jar we download to check which version we got. Since we don't want anything but the latest SNAPSHOT this causes real confusion and headaches, for no advnatage. I don't believe rolling back to maven 2.x is an option, is there any other solution? Can we make nexus only keep the last version? Would re-deploying a release version workaround this problem
        Hide
        Rich Seddon added a comment -

        Is it possible to configure FuseSource to use the REST API to get latest snapshot?

        https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.HowcanIretrieveasnapshotifIdon%27tknowtheexactfilename?

        Show
        Rich Seddon added a comment - Is it possible to configure FuseSource to use the REST API to get latest snapshot? https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.HowcanIretrieveasnapshotifIdon%27tknowtheexactfilename?
        Hide
        Peter Lawrey added a comment -

        The real solution is to fix Fuse, and I have no idea how to make such a configuration change. It is a bit frustrating that a workaround used to available, but is not longer. We will contact our support for Fuse to see what they can do.

        Show
        Peter Lawrey added a comment - The real solution is to fix Fuse, and I have no idea how to make such a configuration change. It is a bit frustrating that a workaround used to available, but is not longer. We will contact our support for Fuse to see what they can do.

          People

          • Assignee:
            Unassigned
            Reporter:
            Dinesh PS
            Last Updated By:
            Rich Seddon
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

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