This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-02
Channels
- # beginners (72)
- # boot (68)
- # cider (51)
- # clara (20)
- # cljs-dev (44)
- # cljsrn (7)
- # clojure (168)
- # clojure-brasil (1)
- # clojure-dev (48)
- # clojure-greece (2)
- # clojure-nl (29)
- # clojure-russia (4)
- # clojure-spec (19)
- # clojure-uk (28)
- # clojurescript (2)
- # cursive (9)
- # datascript (1)
- # datomic (105)
- # dirac (1)
- # docker (2)
- # duct (11)
- # emacs (19)
- # events (1)
- # figwheel (1)
- # fulcro (23)
- # garden (4)
- # graphql (5)
- # hoplon (46)
- # jobs (5)
- # juxt (13)
- # leiningen (6)
- # lumo (12)
- # off-topic (29)
- # parinfer (5)
- # re-frame (7)
- # reagent (6)
- # ring (2)
- # sql (5)
- # yada (6)
is there a specific directory where I should be executing the lein script from: https://github.com/technomancy/leiningen#installation ? I did brew uninstall leiningen. Now I downloaded the script and ran it in the terminal. It outputted some available tasks but I can't get "lein" command to be recognized by the system after it supposedly installed.
Leiningen is a tool for working with Clojure projects.
Several tasks are available:
change Rewrite project.clj by applying a function.
check Check syntax and warn on reflection.
classpath Print the classpath of the current project.
clean Remove all files from project's target-path.
compile Compile Clojure source into .class files.
deploy Build and deploy jar to remote repository.
deps Download all dependencies.
do Higher-order task to perform other tasks in succession.
help Display a list of tasks or help for a given task.
install Install the current project to the local repository.
jar Package up all the project's files into a jar file.
javac Compile Java source files.
new Generate project scaffolding based on a template.
plugin DEPRECATED. Please use the :user profile instead.
pom Write a pom.xml file to disk for Maven interoperability.
release Perform :release-tasks.
repl Start a repl session either with the current project or standalone.
retest Run only the test namespaces which failed last time around.
run Run a -main function with optional command-line arguments.
search Search Central and Clojars for published artifacts.
show-profiles List all available profiles or display one if given an argument.
test Run the project's tests.
trampoline Run a task without nesting the project's JVM inside Leiningen's.
uberjar Package up the project files and dependencies into a jar file.
update-in Perform arbitrary transformations on your project map.
upgrade Upgrade Leiningen to specified version or latest stable.
vcs Interact with the version control system.
version Print version for Leiningen and the current JVM.
with-profile Apply the given task with the profile(s) specified.
Run `lein help $TASK` for details.
Global Options:
-o Run a task offline.
-U Run a task after forcing update of snapshots.
-h, --help Print this help or help for a specific task.
-v, --version Print Leiningen's version.
These aliases are available:
downgrade, expands to upgrade
See also: readme, faq, tutorial, news, sample, profiles, deploying, gpg,
mixed-source, templates, and copying.
[tlomberg@tlomberg-mac /Users/tlomberg/workspace] $ lein install
-bash: lein: command not found
Depending on your OS, I'd Google it. Typically there's an environment variable, PATH, where you add directories. If you're on Linux/Mac type 'echo $PATH' in a shell and you can install lein into something found in the result. I have mine in /usr/local/bin.
[tlomberg@tlomberg-mac /usr/local/bin] $ echo $PATH /Users/tlomberg/:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/kerberos/sbin:/usr/kerberos/bin
Did you follow the instructions in the link you posted above? Have you made the script executable? What behavior do you see?
[tlomberg@tlomberg-mac /usr/local/bin] $ . lein-install-script.sh
dirname: illegal option -- b
usage: dirname path
dirname: illegal option -- b
usage: dirname path
Leiningen is a tool for working with Clojure projects.
Several tasks are available:
change Rewrite project.clj by applying a function.
check Check syntax and warn on reflection.
classpath Print the classpath of the current project.
clean Remove all files from project's target-path.
compile Compile Clojure source into .class files.
deploy Build and deploy jar to remote repository.
deps Download all dependencies.
do Higher-order task to perform other tasks in succession.
help Display a list of tasks or help for a given task.
install Install the current project to the local repository.
jar Package up all the project's files into a jar file.
javac Compile Java source files.
new Generate project scaffolding based on a template.
plugin DEPRECATED. Please use the :user profile instead.
pom Write a pom.xml file to disk for Maven interoperability.
release Perform :release-tasks.
repl Start a repl session either with the current project or standalone.
retest Run only the test namespaces which failed last time around.
run Run a -main function with optional command-line arguments.
search Search Central and Clojars for published artifacts.
show-profiles List all available profiles or display one if given an argument.
test Run the project's tests.
trampoline Run a task without nesting the project's JVM inside Leiningen's.
uberjar Package up the project files and dependencies into a jar file.
update-in Perform arbitrary transformations on your project map.
upgrade Upgrade Leiningen to specified version or latest stable.
vcs Interact with the version control system.
version Print version for Leiningen and the current JVM.
with-profile Apply the given task with the profile(s) specified.
Run `lein help $TASK` for details.
Global Options:
-o Run a task offline.
-U Run a task after forcing update of snapshots.
-h, --help Print this help or help for a specific task.
-v, --version Print Leiningen's version.
These aliases are available:
downgrade, expands to upgrade
See also: readme, faq, tutorial, news, sample, profiles, deploying, gpg,
mixed-source, templates, and copying.
[Process completed]
what you downloaded and named lein-install-script.sh
is literally the lein
command. You would copy that script to /usr/local/bin/lein
(for example) and chmod +x /usr/local/bin/lein
and at that point if you type which lein
in your shell, it should respond /usr/local/bin/lein
Right, I see that now š Change the file to 'lein' as @gonewest818 says.
In your transcript above, I see you are also sourcing the file (`. lein-install-script.sh`) but when all is said and done you will just run lein
at the prompt.
The āinstallationā they are referring to is really just downloading the leiningen jar. By default the jar is placed in ~/.lein/self-installs/leiningen-$(VERSION)-standalone.jar
. Because in general different projects may use different versions of leiningen you could end up with more than one jar in the self-installs
directory and thatās fine. You shouldnāt really need to worry about that.
How could I turn [0 1 2 3]
into [[0 1] [1 2] [2 3]]
? kind of like joining them.
@caleb.macdonaldblack sounds like partition
...
@seancorfield Awesome thanks! (partition 2 1 [0 1 2 3]) => ((0 1) (1 2) (2 3))
@gonewest818 @the2bears @noisesmith @tanzoniteblack Thank you for your help!
- ? are both valid constituent characters for symbols
Still having leiningen problems, after I installed lein script in /usr/local/bin and started using it, Iām seeing strange behavior: When I try to package a jar, I see the following:
[tlomberg@tlomberg-mac /Users/tlomberg/workspace/recruit-app] $ lein deploy
Tried to use insecure HTTP repository without TLS.
This is almost certainly a mistake; however in rare cases where it's
intentional please see `lein help faq` for details.Tried to use insecure HTTP repository without TLS.
This is almost certainly a mistake; however in rare cases where it's
intentional please see `lein help faq` for details.
[tlomberg@tlomberg-mac /Users/tlomberg/workspace/gardner] $ lein deploy
Created /Users/tlomberg/workspace/gardner/target/gardner-0.4.9-SNAPSHOT.jar
Wrote /Users/tlomberg/workspace/gardner/pom.xml
Tried to use insecure HTTP repository without TLS.
This is almost certainly a mistake; however in rare cases where it's
intentional please see `lein help faq` for details.
This is something that leiningen 2.8.1 does if you are using http repositories in your setup. If you can't switch from http to https you can run lein upgrade 2.7.1
for a temporary workaround
if all you want is to make a jar, you don't need to use deploy, just use lein jar
or even lein install
to put it in your local cache (in case you literally meant "package a jar" and not put a jar in a repo)
you can use jar
, install
or uberjar
, depending on what you want, if you actually just want to package it
either upgrade your nexus to use https, or downgrade to 2.7.1
https is the better option, though I know that isn't always under your control
are you doing this on the same machine? Unless you need this go through nexus you can just use lein install
but yes, upgrading/reconfiguring nexus to use TLS is the correct answer, even if that means badgering IT to do an upgrade
what's the most modern way to quickly bring in a dependency for an experiment without doing a project?
I'm trying to use Clojure like a scripting language. Ie. Do lein repl
run a few commands and then be done with it.
lein-try
seems to be an option (https://github.com/rkneufeld/lein-try) seems to be an option but it's kinda old and not sure if it's best practice
is the clj
command that came with 1.9 a path I should consider?
@husain.mohssen lein-try should totally work, itās using a very slow-moving part of the ecosystem. did you try it? they used it to verify all the recipes in the Clojure Cookbook. clj
command will be a fun learning experience, if it doesnāt work š i know @mfikes has already got a lot of practice putting these one-liners together
@robert-stuttaford thanks! what does the last line mean? Can I bring external dependencies using the new clj
from the command line?
ah - i donāt know - i was kinda going on the idea that you knew š
reading https://clojure.org/guides/deps_and_cli and https://github.com/clojure/tools.deps.alpha now
ok. seems you need a deps.edn
@husain.mohssen. youāll probably win through in 10 minutes if you try it out
yes that works, but in that case Im better off using lein try
since that does not require an external file.
btw is there a reason to prefer clj
over lein repl
in 1.9?
@husain.mohssen @robert-stuttaford you do not need a deps.edn:
~$ clj -Sdeps "{:deps {org.clojure/core.async {:mvn/version \"0.4.474\"}}}"
Clojure 1.9.0
user=> (require '[clojure.core.async :as async])
nil
user=> (async/chan)
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x276b68af "clojure.core.async.impl.channels.ManyToManyChannel@276b68af"]
if you donāt want to use lein any more, thatād be one great reason š
and tools.deps allows you to use git repos and local directories as deps, first-class. no more lein install / checkouts shenanigans
that is rad @sundarj
clj --help
@husain.mohssen
you can open a cljs repl with it too:
clj -Sdeps "{:deps {org.clojure/clojurescript {:mvn/version \"1.9.946\"}}}" -m cljs.repl.node
ClojureScript Node.js REPL server listening on 49391
To quit, type: :cljs/quit
cljs.user=> (.log js/console "hello node")
hello node
nil
@sundarj where did you find -Sdeps
in the docs? rather, where is it documented
Itās new if you donāt have the latest
thanks - i donāt know how i missed it on there š
yes, it talks to your local ssh-agent
to provide credentials
so works with github private repos for example
yeah (presuming you register your identity with your ssh agent)
with github, most people use the [email protected]:user/project.git
url
which is ssh
the thing it gives you on a project page under the āclone or downloadā button
UnknownHostKey: http://gitlab.com. RSA key fingerprint is b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:09
@alexmiller most people do not use ssh at github
UnknownHostKey:
@rcustodio to avoid that issue, first do ssh
and accept the host key -- then try again with clj
one sec -- there is a way to force a particular algorithm for the host key, digging it up
the other thing that has come up is host keys in non-rsa keys, which the current path doesnāt handle by default
(through an ssh-agent it does the right thing, but not if you have entries in .ssh/config
)
interesting
yeah, thatās interesting
@chris @noisesmith @mpenet Thank you! downgrading to 2.7.1 worked for me
eventually we will uncover and document all of the complexities around using git deps :)
Now, I dunno what this error means
Error building classpath. Manifest type not detected when finding deps for vikingmakt/njord in coordinate {:git/url "", :tag "0.3.0", :sha "862c1f6d91293e5ba7b621a6db2a07149c90eab7"}
Because its not a jar? Not released?itās trying to understand the dependencies of that project
by detecting a manifest file like deps.edn or pom.xml
it does not (yet) understand project.clj
so yes, youāll need a deps.edn to declare deps for now
if it doesnāt have any deps, you could add :deps/manifest :deps
to force deps.edn and it will tolerate the missing manifest file
@alexmiller Any chance future versions of clj
will have syntactic sugar for dependencies that make it less verbose to quickly test something (a-la lein try
) ?
you can already do that through clj -Sdeps
@husain.mohssen
(if you single quote the outer argument, then you don't have to escape the inner string)
In maven we have -U to download the repositories to the internal repository if its not present there
-U,--update-snapshots Forces a check for missing releases and updated snapshots on remote repositories
@rnagpal same flag, -U
but also, in case there's any miscommunication - every dep leiningen uses is put in the local cache, -U is for checking for a newer snapshot even if you have one that's been fetched within the last 24 hours
@noisesmith -U doesnāt have any affect
what do you expect that isn't happening/
leiningen always does this
unless you mean some actual repo other than the .m2 cache?
mvn -U just checks for new snapshots, according to the man page
which is what lein -U does
are you expecting auto version upgrading?
you need a different kind of dep version tag for that, it's the same syntax used for maven though
the leiningen team and community are highly opinionated against version ranges
so yo uwont' see many examples of that in the wild
but if you ask for a version range, you get compatible behavior
nopes, I dont want auto version upgrades. I just want to pull the missing release jars in the internal repo if they are missing there
I have no idea what's going on here or what you are expecting, maybe someone else can help, sorry
Thanks for trying to help @noisesmith
Does anyone know of a tool that will scan a clojure project dependencies and collect the license information from clojars? There are several tools that will do the java libraries, but they donāt seem to know about clojars.
yeah, Iāll probably have to resort to writing my own crawler against the clojars api. Was hoping someone already did. š
I think it would be fairly straightforward to add the license to https://github.com/clojars/clojars-web/wiki/Data#useful-extracts-from-the-poms
you could also visit each pom.xml accompanying each jar on the classpath, and extract the license
data
or that!
soā¦ letās say iāve got a java dependency iād like to bring in that requires jvm 1.8. what are my options, if i want to support 1.6/1.7 users in some way (across lein, boot, tools.deps.alpha, maven)? spitballing ideas so far:
- use a āprovidedā dependency and require the consumer to decide whether to pull it in; have the code see if the relevant classes are available at runtime (similar to what clojure.core.reducers
does)
- abandon pre-jvm-1.8; require consumers to upgrade
is there anything else?
- Create two variants of the JAR for consumers to pick ?
There are some options, I new of some java collogues using some library where they could use lambda's, and still compile to 1.7. but when the incompatibilities are in libraries, and not in your own code, it might be more challenging.
Java 9 has Multi-Release JARs, but that doesn't help you yet @trptcolin
I would say unless you are supporting something specific for, say, enterprise you can safely say sayonara
so if we go non-hypothetical: this is for reply (which is the leiningen / boot repl). i donāt think abandoning < 1.8 is realistic [could be wrong]
maybe the 2018 clojure survey results will have a different answer than i expect š
:thinking_face: > After April 2015, Oracle will no longer post updates of Java SE 7 to its public download sites.
2017 survey results had minimal java 7 (sorry not trying to make your life hard @chris )
Iām ready to abandon java 7 for clojure :)
2018 results so far are showing ~6% of people still using java 7 and <0.4% still using java 6
90% are using java 8
the new clj tool requires 1.8
java 1.8 that is
java 1.8 is set to end public updates in Jan 2019
Google is only testing Closure-compiler using 1.8 and is using 1.8 features on tests at least (it might still be possible to run Closure, and Cljs, on Java 1.8, but probably not for long)
thanks yāall, good stuff. seems like thereās a pretty reasonable case for abandoning pre-1.8, good news
for anyone else looking to enumerate licenses, https://github.com/technomancy/lein-licenses does the trick!