Search code examples
mavennugetpaket

Is it possible to implement snapshot versioning with Paket?


Maven is a dependency manager in the Java world. It supports snapshot versioning. In Maven-speak a dependency is called an artifact. An artifact with a fixed version number (e.g. 1.0.1) will be downloaded only once because it will never change. On the contrary a snapshot version (e.g. 1.0.1-Snapshot) will be considered as a moving target. It is a current development copy and will likely change in the near future. Therefore it has to be updated on a regular basis. With snapshot versioning you are able to provide the current state of an ongoing development as an artifact through your artifact delivery mechanism (for example with Nexus or Artifactory). In combination with a CI build which creates the snapshot artifacts you are able to setup a development infrastructure with can handle fairly complex projects.

In essence I think snapshot versioning means the dependency manager needs to check and download artifacts with a version tag which it has already downloaded before.

In the .NET world Nuget is the prefered package manager. As a dependency manager it does a very lousy job. In particlur it does not support snapshot versioning: NuGet Cache And Versioning Issues

Paket is an alternative package manager. It is clearly better suited to do the dependency management in real life projects but I could not find something in the documentation about snapshot versioning. https://fsprojects.github.io/Paket/

My question: Is it possible to implement snapshot versioning with Paket?

Futher explanations about snapshot versioning:
What exactly is a Maven Snapshot and why do we need it?
http://www.tutorialspoint.com/maven/maven_snapshots.htm
https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855


Solution

  • Olaf, I don't think this is supported in paket.dependencies but consider this alternative:

    1 put a flexible version restriction in paket.dependencies

    nuget GreatDependency ~> 1.0.1
    

    2 invoke custom paket update on build

    .paket\paket update nuget GreatDependency