Fork me on GitHub
#boot
<
2016-05-04
>
dimiter12:05:15

Hi, I need to include a third-party JAR in my BOOT Project without having it in Maven.

micha12:05:55

@dimiter: you can use BOOT_JVM_OPTIONS to add it to the classpath

micha12:05:09

use the -cp java option

micha12:05:27

(BOOT_JVM_OPTIONS is an environment variable)

dimiter12:05:44

Yes, that much I know, but I also need to package is as part of my UBERJAR.

alandipert13:05:46

@dimiter: maybe the easiest thing to do is install it to your local maven repo using the maven install task

alandipert13:05:07

another option is to write a task that explodes the jar and adds its contents as resources to the fileset

alandipert13:05:24

most of the code to do that is already in boot, you'd just need to wire it up. you can look at the uber builtin

alandipert13:05:02

there are also boot functions to install jars to the local maven repo, so that part you could perhaps drive from your build.boot instead of calling maven. if you go the local repo route

dimiter13:05:06

Ok. I did install it to my local repo. When I do an Uberjar, will all the dependencies be packaged with it?

dimiter13:05:08

mvn install:install-file -Dfile=/opt/mylibs/102opswclient.jar -DgroupId=com.opsware -DartifactId=opswclient -Dversion=10.2.0 -Dpackaging=jar -DgeneratePom=true

alandipert13:05:45

so now in your build.boot do (set-env! :dependencies '[[com.opsware/opswclient "10.2.0"]]) or similar

dimiter13:05:24

Great. Thanks.

adamfrey14:05:34

Iā€™m making a boot library that makes changes to html resource files. Whenever I dump the result with the target task, it always works correctly, but serving with boot-http from the classpath seems to be non-deterministic with whether it shows me the original html file or the updated version from my task. Has anyone else experienced this with boot-http? @pandeiro

adamfrey14:05:22

my pipeline is

(deftask dev []
  (comp
    (watch)
    (serve :port 5000 :reload true)
    (inspect-classpath)
    (asset-fingerprint)
    (inspect-classpath)
    (target)))

adamfrey14:05:25

where the inspect-classpath prints the file contents in the classpath before and after the asset-fingerprint task. It is always prints the updated version correctly, but sometimes boot-http still serves the old file.

edannenberg14:05:13

is there any way to influence the order of dependencies in cljs_deps.js? having some issues with https://github.com/madvas/cljs-react-material-ui, load order works in one project but not in another, almost the same build.boot setup

martinklepsch14:05:49

@edannenberg: this sounds like it might be more related to ClojureScript than Boot?

martinklepsch14:05:32

@adamfrey: are you making sure you're waiting long enough before reloading?

adamfrey14:05:19

you mean in my browser/curl? Yeah if it serves the old file than it keeps serving the old file util I restart the pipeline

martinklepsch14:05:51

@adamfrey: oh, I see. Haven't had similar experiences fwiw

edannenberg14:05:05

@martinklepsch: hmm probably, will try my luck there

adamfrey15:05:20

so boot-http runs the server in a pod, with an isolated classpath. If I commit! changes to a classpath file from a different task, should boot-http see the updated changes in the classpath on the next request?

adamfrey16:05:03

my stale classpath resources problem is completely non-deterministic without any code changes, so that leads me to suspect a race condition. Are pods are run in different threads by default?

martinklepsch19:05:08

Whats the right way to ensure that a jar command is able to find the right artifact name/version after (uber)?

martinklepsch19:05:38

Excluding pom.xml files from being imported? Manually specifying the filename?

micha19:05:02

@martinklepsch: i think manually specify filename

micha19:05:24

dependency jars may assume that they will be able to find their own pom.xml on the classpath

micha19:05:33

so removing those could cause weird bugs

sarudak20:05:46

Hello everyone I am struggling to use boot to build a hybrid java clojure codebase. Is there any easy boot equivalent to leiningens :java-source-paths ["src/java"] option?

hlolli21:05:08

How can I add a local repository for a single project. My idea reading the manual was to add this to build.boot :repositories {"central" "" "repo" :offline} where repo is a directory in the root directory of a boot project.

hlolli21:05:29

ahh god bless google search

:repositories {"clojars" ""
                "central" ""
                "local" (str (.toURI (java.io.File. "repo")))}

alandipert22:05:37

@sarudak: there's the javac builtin task

micha22:05:02

@hlolli: that's neat, we should make a note somewhere in the wiki about that

sarudak22:05:36

It doesn't seem to do anything. I have :src-paths #{"src/clj" "src/java"} and then I do (deftask uber-build [] (comp (javac) (aot) (uber) (jar))) but none of the java ends up in the jar

micha22:05:41

@sarudak: i believe it's :source-paths, not :src-paths

sarudak22:05:43

You were totally right I just had the wrong keyword

alandipert22:05:11

in your defense, it was src-paths in early versions of boot šŸ˜„

sarudak22:05:29

Ah. There's a lot of old articles about boot floating around

micha22:05:56

if you want to see some defaults you can go to a directory without a build.boot file and do boot show -e

micha22:05:16

that will show the default settings for most of the keys you are interested in

sarudak22:05:20

Good to know

sarudak22:05:30

That should be in the readme somewhere šŸ˜›

sarudak22:05:48

Discoverability of option maps is poor in clojure

micha22:05:07

i guess you can do boot -B show -e anywhere

micha22:05:16

the -B disables the build.boot

alandipert22:05:21

maybe also tack on -P to disable ~/.boot/profile.boot

sarudak22:05:45

That's helpful thanks

michael.heuberger23:05:09

i have a boot issue here. often when i am in the middle of doing a change, it crashes

michael.heuberger23:05:12

like that:

Exception in thread "Thread-17" java.io.FileNotFoundException: src/cljs/ui_sandbox/app.cljs___jb_tmp___ (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at $fn__9235.invoke(io.clj:344)
	at clojure.lang.MultiFn.invoke(MultiFn.java:238)
	at $copy.doInvoke(io.clj:396)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at clojure.core$partial$fn__4527.invoke(core.clj:2493)
	at boot.file$copy_with_lastmod.invoke(file.clj:144)
	at boot.file$sync_BANG_.doInvoke(file.clj:190)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invoke(core.clj:634)
	at boot.core$sync_user_dirs_BANG_$fn__457.invoke(core.clj:115)
	at boot.core$sync_user_dirs_BANG_.invoke(core.clj:113)
	at boot.core$set_user_dirs_BANG_$on_change__478.invoke(core.clj:152)
	at boot.core$watch_dirs$fn__667.invoke(core.clj:524)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:745)

micha23:05:53

@michael.heuberger: is your editor creating those files?

micha23:05:32

2.6.0-SNAPSHOT should help with that, there was a patch for a related issue

michael.heuberger23:05:59

@micha: using intellij here - not sure if it causes it

micha23:05:44

there is really no way to perform atomic transactions on the filesystem

micha23:05:58

so things that create and destroy files all over the place will cause race conditions

micha23:05:57

but 2.6.0-SNAPSHOT should help, probably will fix your issue

michael.heuberger23:05:46

great - when it is coming out?

micha23:05:10

you can use it now, just do BOOT_VERSION=2.6.0-SNAPSHOT boot -h