Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uberjar question #72

Open
danoyoung opened this issue Dec 5, 2018 · 3 comments
Open

uberjar question #72

danoyoung opened this issue Dec 5, 2018 · 3 comments

Comments

@danoyoung
Copy link

This is a newbie question, trying to use the lein-tool-deps with my project, but I can't seem to get the uberjar part to work. When I run lein uberjar, I see the target directiory and the SNAPSHOT.jar file, but it just keeps growing and growing. I finally kill it after 10GB or so. When I just use lein dependencies w/o lein-tools-deps, the uberjar is created.... Any idea with what I might be doing wrong?

Here's my project.clj

(defproject dlp-inspect "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  ; NOTE: the deps are managed via deps.edn and the lein-tools-deps plugin...
  ;;:dependencies [[org.clojure/clojure "1.9.0"]
  ;;               [datasplash "0.6.3"]
  ;;               [clj-time "0.15.0"]]
  ;;:dependencies []
  :plugins [[lein-tools-deps "0.4.1"]]
  :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
  :lein-tools-deps/config {:config-files [:install :user :project "./deps.edn"]
                           :clojure-executables ["/usr/local/bin/clojure"]}
  :clean-targets ^{:protect false} [...targets...]
  :profiles {:dev {:global-vars {*warn-on-reflection* false}}}
  :uberjar-name "dlp-inspect.jar"
  :manifest {"Class-Path" "."}
  :jvm-opts ["-Xms2g" "-server" "-Xmx4g"]
  :tar {:uberjar true}
  :jar-exclusions [#".DS_Store"]
  :uberjar-exclusions [#".DS_Store" #"META-INF/*.DSA" #"META-INF/*.RSA" #"META-INF/*.SF" #"META-INF/LICENSE"]
  :min-lein-version "2.8.0"
  :aot :all
  :main dlp-inspect.core)

My deps.edn

{
 :paths ["src" "target" "resources"]
 ;; External dependencies
 :deps          {
                 org.clojure/clojure {:mvn/version "1.9.0"}
                 org.clojure/tools.cli {:mvn/version "0.4.1"}
                 clj-time {:mvn/version "0.15.0"}
                 datasplash {:mvn/version "0.6.3" :exclusions [io.grpc/grpc-core]}}


 :mvn/repos     {"central" {:url "https://repo1.maven.org/maven2/"}
                 "clojars" {:url "https://clojars.org/repo"}}}
@RickMoynihan
Copy link
Owner

You have a lot of properties configuring leiningen and the uberjar... does it do it if you cut this down?

@danoyoung
Copy link
Author

danoyoung commented Dec 5, 2018

This is what I have now;

when I run lein uberjar, seems to be spinning and the dlp-inspect-0.1.0-SNAPSHOT.jar just keeps growing and growing, finally kill is after it gets to +3GB. When just using lein w/o the plugin, the file uberjar is around 98MB

Compiling dlp-inspect.core
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Compiling dlp-inspect.core

(defproject dlp-inspect "0.1.0-SNAPSHOT"
  :plugins [[lein-tools-deps "0.4.1"]]
  :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
  :lein-tools-deps/config {:config-files [:install :user :project "./deps.edn"]
                           :clojure-executables ["/usr/local/bin/clojure"]}
  :clean-targets ^{:protect false} [...targets...]
  :profiles {:dev {:global-vars {*warn-on-reflection* false}}
             :uberjar {:uberjar-name "dlp-inspect.jar"
                       :aot :all
                       :main dlp-inspect.core}}
  :min-lein-version "2.8.0")
  :main dlp-inspect.core)

@RickMoynihan
Copy link
Owner

Not sure if this is causing it but :project and "./deps.edn" both reference the same file. :project is a shorthand to include the deps.edn from your projects root directory. If you remove the "./deps.edn" bit do you still see the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants