Fork me on GitHub
#clojars
<
2021-11-02
>
Takis_20:11:53

hello, when i should use a -SNAPSHOT version for a project? i have 3 projects, and 1 of them is dependency to both , they are under active development, not well tested etc

seancorfield20:11:41

Are you using Leiningen or the Clojure CLI to do development/JAR building?

seancorfield20:11:37

The CLI (`deps.edn`) supports both local (filesystem) and git deps so you don't need anything published to Clojars -- you can just depend on the unpublished versions.

seancorfield20:11:55

I think Leiningen has checkout dependencies that let you do something similar.

seancorfield20:11:12

If you publish SNAPSHOTs, the dependency management system (in lein or clojure) is not going to check for updates every time, as I recall, so it is harder to work with development projects with SNAPSHOTs anyway.

Takis_20:11:41

thank you so i will just use github? and people will find it from github? and deploy nothing on clojars?

seancorfield20:11:18

The other downside to SNAPSHOTs is that a lot of people won't use any libraries that have dependencies that are SNAPSHOTs so you'd have to do non-snapshot releases of them all if you release JARs for other people to use.

phronmophobic20:11:56

if you don't need public access, you can test locally with lein by using lein install which will install the library in your local maven repository

seancorfield20:11:13

Yes, it's common with deps.edn and the Clojure CLI to get libraries direct from GitHub with nothing published on Clojars. Less common with lein (because it's not so good for working with git deps etc).

tcrawley20:11:48

In general, you use SNAPSHOT versions when you want to share something that is still in progress. To answer your questions about overwriting: • non-SNAPSHOT versions are immutable - you cannot overwrite them when deployed • SNAPSHOTs are really a pointer to a timestamped version. So you can deploy a new SNAPSHOT of the same version, but under the hood that is a timestamped version that the SNAPSHOT version points to. For example, here are the timestamped versions for a SNAPSHOT version: https://repo.clojars.org/com/flipkart/aesop/runtime-snapshot-serializer/1.1.0-SNAPSHOT/

seancorfield20:11:48

lein install is still a clunky manual process compared to proper local filesystem dependencies.

seancorfield20:11:42

@U06SGCEHJ @U7RJTCH6J Remind me, when/how often does lein check for an updated SNAPSHOT? Is it just once a day?

Takis_20:11:03

my projects are leinengein projects, would like to use github dependencies but i dont know how

tcrawley20:11:04

You can pin to a timestamped SNAPSHOT if you want build stability, since it is immutable (for example, using 1.1.0-20150327.093713-4 instead of 1.1.0-SNAPSHOT for that examlpe

tcrawley20:11:25

I don't know what the SNAPSHOT refresh frequency is

phronmophobic20:11:37

right, but learning a new tool and reconfiguring all your projects can also be clunky. I think deps.edn does help with these types of workflows, but I'm also aware that changing tools is non trivial

Takis_20:11:05

if deps.edn and the Clojure CLI, are better way i can read those. anyway thank you for the information

Takis_20:11:15

i will read about those and see : )

👍 1
Takis_20:11:14

but people that use lein they will not be able to use my library from github?

phronmophobic20:11:43

I think there are lein plugins that work with git dependencies, but I haven't tried any of them and I'm not sure how easy it is. With deps.edn, it is possible to do a combination of local/git on your machine and publish snapshots to clojars as needed

Takis_20:11:19

thank you alot : ) i will read about deps.edn and the lein plugin

seancorfield20:11:09

@U68Q5G1BJ Re: lein and github -- that's why I said: > The other downside to SNAPSHOTs is that a lot of people won't use any libraries that have dependencies that are SNAPSHOTs so you'd have to do non-snapshot releases of them all if you release JARs for other people to use. I wasn't suggesting you try to let others use your libraries via GitHub -- I was just offering that as an option for you while you are developing and still evolving your libraries. lein checkouts is apparently a common approach for using checked-out git repos locally (via symlinks) when you're working on multiple libraries in parallel like that.

seancorfield20:11:27

(I don't have any details -- I stopped using Leiningen six years ago -- but I remember people talking about that approach)

Takis_20:11:57

ok thank you i saved all those, and i will read for those : )

seancorfield20:11:33

The #leiningen channel might be helpful if you want to dig into checkouts

deactivateduser20:11:20

(apologies for Lazarus’ing this thread) this is a good use case for http://jitpack.io (which supports Leiningen, amongst other build tools).

Takis_12:11:39

thank you pmonks looks useful alot, i saw it in the past i will re-check it.

Takis_20:11:54

also if i deploy a specific version (snapshot or not), can i overwrite that version?

Takis_20:11:31

i used clojars in the past, but i cant say i understand all things, any link is welcomed , i read the tutorial now on wiki of clojars