Folks, I'm trying to help @rcustodio with a boot-tools-deps
issue and what we've run into is that his project has a locally built JAR file (Java code) that needs to get included into an uberjar -- but boot-tools-deps
doesn't know how to tell Boot about it.
It can't go on :resource-paths
(because Boot tries to copy "source files" from those locations -- and throws an exception if it gets a file, rather than a directory there, it seems). It can't go on :dependencies
because it's not something Boot knows how to fetch.
Is it possible to use a locally built JAR that is not in a Maven repo (or the ~/.m2
cache) with boot ... uber ...
@seancorfield do i understand right that you want the jar's contents, not the .jar, to be added to the fileset and included in an uberjar?
@alandipert Yes, I think that would be the end game.
(so, treated just like a :dependency
JAR that was downloaded)
For running the project, it's fine to just add it to the classpath (which boot-tools-deps
does), but the uber
/ jar
tasks don't pay attention to the classpath, only to :resource-paths
and :dependencies
(well, and :asset-paths
).
Ah, missed the nuances of that.
(personally, I'd just stick it in the local ~/.m2
cache after building it locally but I'm not sure how practical that is for @rcustodio’s workflow?)
yeah, i think that's probably the best way too. but in the past i seem to recall using some of the functions in the worker pod to unzip jars to the fileset
@rcustodio It might be simpler for you overall to just run mvn install
in that imgscalr
project and it will put 4.3.0-SNAPSHOT into your local Maven cache folder -- and then just depend on that version in your main project instead.
I see… thanks @seancorfield, I will do that
Although, that said, when I tried it, the tests failed so the install
goal failed:
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.354 sec <<< FAILURE!
testApply4(org.imgscalr.ScalrApplyTest) Time elapsed: 0.125 sec <<< FAILURE!
java.lang.AssertionError: expected:<-11842741> but was:<-11908534>
ant clean jar
works (and produces a 4.2 versioned lib) so I guess you could build it that way and install it to ~/.m2
with https://github.com/seancorfield/boot-localrepo
So ant clean jar && boot -d seancorfield/boot-localrepo install-artifact -f dist/imgscalr-lib-4.2.jar -P org.imgscalr/imgscalr-lib -v 4.3.0-pre
and then depend on org.imgscalr/imgscalr-lib "4.3.0-pre"
(using that name avoid the SNAPSHOT issues and also means you won't conflict with a real 4.3.0 release of the library later @rcustodio)
Thanks @seancorfield