tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
2020-07-16T19:51:43.395400Z

If I want to publish a tools deps project as a jar to a repo (e.g. clojars) and I have an up-to-date pom.xml, what is the "right" artifact to publish if you are using git coordinates for your dependencies? Do I need to create an uberjar and publish that? Is there a way to package the git deps src in a regular jar target? This is assuming a library project with git dependencies.

alexmiller 2020-07-16T20:01:13.395700Z

there is no way to do that

alexmiller 2020-07-16T20:01:26.396Z

git deps are only usable from source deps

alexmiller 2020-07-16T20:02:21.396500Z

as soon as you say "artifact", you're talking about maven and you need to depend only on other artifacts

2020-07-16T20:03:05.397200Z

Makes sense. Seems like an uberjar as lib or jar + git deps as lib would be a mess.

kenny 2020-07-16T20:17:51.398400Z

Is there a Maven command or Clojure lib someone made that uploads a jar file to a S3 bucket? All the tools I've found seem like they expect to build the jar for you.

alexmiller 2020-07-16T20:18:52.398900Z

well you can just do an aws s3 cp if that's sufficient

kenny 2020-07-16T20:20:06.399600Z

I tried that and receive this message from tools-deps "Download corrupted: Checksum validation failed, no checksums available." It actually all works (i.e., jvm starts up with the jar on the cp) but it'd be nice to do it the correct way.

kenny 2020-07-16T20:20:33.399900Z

Or maybe that's a bug in tools-deps?

alexmiller 2020-07-16T20:24:53.400600Z

well if you just upload the jar without the checksum files, you will see this message

kenny 2020-07-16T20:26:43.402800Z

I figured. Is there something out there that can do this the correct way to avoid this warning?

alexmiller 2020-07-16T20:28:13.404300Z

the correct way is to compute an md5 or sha1 checksum for the jar and upload those (and ideally to gpg sign all of those files as well). I do not know of a tool that does that (although I have started working on one)

alexmiller 2020-07-16T20:29:11.404800Z

an example of what goes into maven central is something like this: https://repo1.maven.org/maven2/org/clojure/tools.deps.alpha/0.8.677/

alexmiller 2020-07-16T20:29:50.405400Z

how that all gets created and uploaded is quite complicated, and clojars does much less (and even less is really required)

alexmiller 2020-07-16T20:30:20.406Z

really, just the jar and the md5 or sha1 file (and ideally the pom) are probably sufficient

alexmiller 2020-07-16T20:31:04.406500Z

you can use a tool like sha1sum or md5sum to make that

alexmiller 2020-07-16T20:32:29.407500Z

there is also a version metadata file that should be updated too (like https://repo1.maven.org/maven2/org/clojure/tools.deps.alpha/maven-metadata.xml) if you want something like RELEASE version to work.

kenny 2020-07-16T20:34:16.408400Z

Wowza. Did not realize what I was getting myself in to. Thank you for all this info. I assume the work you started on is not public yet?

alexmiller 2020-07-16T20:35:49.408900Z

no, nothing usable

alexmiller 2020-07-16T20:37:12.410400Z

I would like to handle a) clojars b) s3 and c) maven central in that order which I think handles both the most common and easiest items first

1
alexmiller 2020-07-16T20:37:46.410900Z

there are multiple options on each and it is way harder than it should be for sure

kenny 2020-07-16T20:42:31.414500Z

Will try the jar + hash suggestion. And try to restrain myself from building something complete. Thanks again 🙂

dominicm 2020-07-16T21:12:25.415Z

Maybe I should build a tool on top of pack. It would force me to finish the api.

2020-07-16T22:11:38.416500Z

For deps that need to be kept in sync, or even in times where its likely two things should udpate together, what strategy have people used? My first thought would be that deps wouldn't be responsible for this and this more when you need a tool like lein. But if i only have this issue maybe soemthing a tad more lightweight.

seancorfield 2020-07-16T22:31:26.417Z

@drewverlee I put them next to each other in deps.edn with a comment explaining the relationship.

seancorfield 2020-07-16T22:32:58.417700Z

(it's a project/application concern, not a tooling concern really -- so it's more about making sure people know how/when to change stuff)

seancorfield 2020-07-16T22:34:16.419200Z

BTW, that's also why I'm generally against tools that update my configuration files automatically -- those tools cannot know about such constraints, e.g., I may have very valid reasons for keeping two particular dependencies on older versions together, even if newer versions of one or both exist.

2020-07-16T23:10:09.420400Z

Seems reasonable, I guess I should start with the comment and add more as needed. Thanks @seancorfield