This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-24
Channels
- # boot (183)
- # business (3)
- # clojure (65)
- # clojure-argentina (1)
- # clojure-china (1)
- # clojure-conj (2)
- # clojure-japan (2)
- # clojure-russia (5)
- # clojure-ukraine (5)
- # clojurescript (139)
- # community-development (1)
- # core-async (8)
- # core-matrix (1)
- # cursive (7)
- # datomic (2)
- # events (4)
- # hoplon (108)
- # ldnproclodo (1)
- # lein-figwheel (1)
- # liberator (1)
- # off-topic (76)
- # om (37)
- # onyx (12)
- # overtone (1)
- # testing (8)
does anyone know a good article on how to import and work with java abstract classes?
Hi. How to add own library(ies) to my project? I.e. to have own repo or something?
You have to have a jar with your library somewhere in your classpath. If you don't share the project with other people the simplest solution is to put the jar into your local maven repo with boot build-jar
or lein install
and then reference that from your project file. If you have to share the project with someone you would probably want to use clojars - tutorial is under https://github.com/ato/clojars-web/wiki/Tutorial. If you can't be arsed to do it properly, because you're just experimenting or don't feel like having to build and install the jar then maybe you could just copy & paste your library sources under the project's source folder and share it that way (though if your library requires something special in your project file you'd have to manually change it for your project).
btw, does it mean that name (on Clojars) must be unique?
ah yep
names are composite
foo.bar.buz.mylib
Actually foo.bar.buz/mylib
to be pedantic. And then mylib
must be unique for all foo.bar.buz
es. I think so, at least.
and if... I have project P1 that depends on lib L1
and I'm contantly making changes on P1 and L1 too?
I'd have few projects. Well, I have libraries already written
some of them
though, having some of them open source is good idea
yes, I used to copy-paste files from project to project
submodule?
If not, then you could probably think about making it an entirely separate project, with it's own project file
for a couple I'd do separate
And you could just at some point push it into clojars when you decide you want to share it
thanks for great and exhaustive help, jaen !
@andrewboltachev: Also checkout leiningen checkouts
for this use-case
thanks colin.yates !
@colin.yates: what's exactly the boon of using checkouts? I mean, I used them, but they did seem to require installing the jar anyway, so I'm not 100% sure what is gained.
AIUI you need to declare it in project.clj and install it first but then the library's source path takes precedence. I also think the dependencies of that dependant lib are taken into account as well
I had impression it didn't work that way and I had to reinstall, though more possibly I was just doing something wrong.
last time I used it, you had to do it only the first time.
is there an elegant solution to using Components and generating lein ring uberwar
which requires the handlers to be a var (so cannot be components)?
ideas: - have the system globally accessible like a global service-locator - yuck
idea 2- have the components create the handlers and then alter var root
with those handlers and call that as the :ring :init
fn
idea 3 - ask here
@clem: I'm not aware of any existing template, so to speak, but you would typically write that as a task to spit out a project skeleton
@colin.yates: I use option #2, it works pretty well
(alter-var-root #'system (fn [_] (com/start (new-system options))))
(alter-var-root #'ring-handler (constantly (-> system :app :app)))
any ideas what's going on here?
user> (require 'riemann.client)
CompilerException java.lang.Exception: namespace 'riemann.codec' not found, compiling:(riemann/client.clj:1:1)
that's riemann-clojure-client 0.4.1, both files are included in jar (just looked), not sure what to do..
@asolovyov: check lein deps :tree
, might be a conflict somewhere
@thheller: weird:
user> (io/resource "riemann/client.clj")
#object[java.net.URL 0x4026843d "jar:file:/Users/piranha/.m2/repository/riemann-clojure-client/riemann-clojure-client/0.4.1/riemann-clojure-client-0.4.1.jar!/riemann/client.clj"]
user> (io/resource "riemann/codec.clj")
#object[java.net.URL 0x49ce821a "jar:file:/Users/piranha/.m2/repository/riemann-clojure-client/riemann-clojure-client/0.4.1/riemann-clojure-client-0.4.1.jar!/riemann/codec.clj"]
user> (require 'riemann.client)
CompilerException java.lang.Exception: namespace 'riemann.codec' not found, compiling:(riemann/client.clj:1:1)