Fork me on GitHub
#tools-deps
<
2019-09-05
>
Quest22:09:03

What's the equivalent of lein install for a clj deps.edn library?

Quest22:09:27

(I don't have any packaging library right now -- just looking through the options at https://github.com/clojure/tools.deps.alpha/wiki/Tools for something easy to get running)

andy.fingerhut22:09:25

If you mean creating a JAR file of Clojure source code, I believe depstar is a good choice.

Quest22:09:56

Appreciate the recommendation, easy enough to get a jar generated with clojure -A:depstar -m hf.depstar.jar northstar-model-0.0.1.jar. The consume the library artifact from other local projects, I take it I manually install to my ~/.m2/ from here -- i.e. copying pom.xml & northstar-model-0.0.1.jar to ~/.m2/northstar/model/0.0.1/

seancorfield23:09:36

@quest If you have mvn installed, that's probably the easiest way to do it "right".

seancorfield23:09:32

(`mvn` is what I use to deploy JARs built with depstar to http://clojars.org -- I've never tried to to install locally but I'm pretty sure it's a similar command)

seancorfield23:09:24

mvn install:install-file -Dfile=northstar-model-0.0.1.jar -DpomFile=pom.xml
I believe

seancorfield23:09:28

You may be able to omit -DpomFile=pom.xml now that depstar includes pom.xml in the JAR... apparently not... it's not quite in the format Maven expects.

Quest23:09:13

Hmm, I'll keep looking through maven install & see if I can find something that works. Faking the .m2 autogen files isn't working out

seancorfield23:09:15

@quest The above command seemed to work for me, based on limited testing

👍 4
Quest23:09:01

Yes! I can confirm that it's working. Thanks @seancorfield

clojure -A:depstar -m hf.depstar.jar northstar-model-0.0.1.jar
mvn install:install-file -Dfile=northstar-model-0.0.1.jar -DpomFile=pom.xml
;; include dependency [northstar/model "0.0.1"]

Quest23:09:26

It seems like it'd be good to document this somewhere, but I'm not exactly sure where :thinking_face:

seancorfield23:09:01

I should add it to the readme...

Quest23:09:45

I'll open a PR with my best attempt to capture it, edit it as needed from there? 🙂

seancorfield23:09:01

Sure! Thank you!

seancorfield23:09:23

Deploy to Clojars is

mvn deploy:deploy-file -Dfile=${1}.jar -DpomFile=pom.xml -DrepositoryId=clojars -Durl=

seancorfield23:09:35

(where ${1} is the jar file name -- and this assumes your credentials are in ~/.m2/settings.xml like

<settings>
  <servers>
    <server>
      <id>clojars</id>
      <username>someperson</username>
      <password>topsecret</password>
    </server>
  </servers>
</settings>

👌 4