Otann / morse

📡 Clojure interface for Telegram Bot API
Eclipse Public License 1.0
257 stars 48 forks source link

Don't leak dev-time dependencies #23

Closed martinklepsch closed 7 years ago

martinklepsch commented 7 years ago

Currently when I run boot -d morse show -d I am presented with the following dependency graph:

[morse "0.2.4"]
├── [cheshire "5.5.0"]
│   ├── [com.fasterxml.jackson.core/jackson-core "2.5.3"]
│   ├── [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.5.3"]
│   ├── [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.5.3"]
│   └── [tigris "0.1.1"]
├── [clj-http "2.1.0"]
│   ├── [commons-codec "1.10" :exclusions [[org.clojure/clojure]]]
│   ├── [commons-io "2.4" :exclusions [[org.clojure/clojure]]]
│   ├── [org.apache.httpcomponents/httpclient "4.5.1" :exclusions [[org.clojure/clojure]]]
│   │   └── [commons-logging "1.2"]
│   ├── [org.apache.httpcomponents/httpcore "4.4.4" :exclusions [[org.clojure/clojure]]]
│   ├── [org.apache.httpcomponents/httpmime "4.5.1" :exclusions [[org.clojure/clojure]]]
│   ├── [potemkin "0.4.3" :exclusions [[org.clojure/clojure]]]
│   │   ├── [clj-tuple "0.2.2"]
│   │   └── [riddley "0.1.12"]
│   └── [slingshot "0.12.2" :exclusions [[org.clojure/clojure]]]
├── [org.clojure/core.async "0.2.374"]
│   └── [org.clojure/tools.analyzer.jvm "0.6.9"]
│       ├── [org.clojure/core.memoize "0.5.8"]
│       │   └── [org.clojure/core.cache "0.6.4"]
│       │       └── [org.clojure/data.priority-map "0.0.4"]
│       ├── [org.clojure/tools.analyzer "0.6.7"]
│       ├── [org.clojure/tools.reader "1.0.0-alpha1"]
│       └── [org.ow2.asm/asm-all "4.2"]
├── [org.clojure/tools.macro "0.1.5"]
│   └── [org.clojure/clojure "1.4.0"]
└── [venantius/ultra "0.4.1"]
    ├── [grimradical/clj-semver "0.3.0" :exclusions [[org.clojure/clojure]]]
    ├── [im.chit/hara.class "2.2.15"]
    │   ├── [im.chit/hara.class.checks "2.2.15"]
    │   ├── [im.chit/hara.class.inheritance "2.2.15"]
    │   └── [im.chit/hara.namespace.import "2.2.15"]
    ├── [im.chit/hara.reflect "2.2.15"]
    │   ├── [im.chit/hara.common.checks "2.2.15"]
    │   ├── [im.chit/hara.common.string "2.2.15"]
    │   ├── [im.chit/hara.common "2.2.15"]
    │   │   ├── [im.chit/hara.common.error "2.2.15"]
    │   │   ├── [im.chit/hara.common.hash "2.2.15"]
    │   │   └── [im.chit/hara.common.primitives "2.2.15"]
    │   ├── [im.chit/hara.data.map "2.2.15"]
    │   └── [im.chit/hara.protocol.string "2.2.15"]
    ├── [io.aviso/pretty "0.1.24"]
    ├── [mvxcvi/puget "1.0.0"]
    │   ├── [fipp "0.6.3"]
    │   │   └── [org.clojure/core.rrb-vector "0.0.11"]
    │   └── [mvxcvi/arrangement "1.0.0"]
    ├── [mvxcvi/whidbey "1.3.0"]
    │   └── [org.clojure/data.codec "0.1.0"]
    ├── [org.clojars.brenton/google-diff-match-patch "0.1"]
    ├── [org.clojure/tools.nrepl "0.2.12"]
    ├── [robert/hooke "1.3.0"]
    └── [venantius/glow "0.1.3"]
        ├── [clj-antlr "0.2.2"]
        │   ├── [org.antlr/antlr4-runtime "4.2.2"]
        │   │   ├── [org.abego.treelayout/org.abego.treelayout.core "1.0.1"]
        │   │   └── [org.antlr/antlr4-annotations "4.2.2"]
        │   └── [org.antlr/antlr4 "4.2.2"]
        │       ├── [org.antlr/ST4 "4.0.8"]
        │       └── [org.antlr/antlr-runtime "3.5.2"]
        ├── [garden "1.1.7"]
        │   └── [com.yahoo.platform.yui/yuicompressor "2.4.7"]
        │       └── [rhino/js "1.6R7"]
        ├── [hiccup "1.0.5"]
        └── [instaparse "1.4.1"]

Half of this isn't needed during run-time and thus it would be nice to remove it from the list of transitive dependencies.

Deraen commented 7 years ago

So I tested how Lein and Ultra work, and looks like the solution is to add ultra to :repl profile instead of :dev: https://github.com/Otann/morse/blob/master/project.clj#L15

This can be tested by running lein install and checking the created pom file:

# ultra on dev profile
~/.m2/repository/plugin-dep-leak/plugin-dep-leak/0.1.0-SNAPSHOT master*
❯ cat plugin-dep-leak-0.1.0-SNAPSHOT.pom | grep ultra
      <artifactId>ultra</artifactId>

# ultra on repl profile
~/.m2/repository/plugin-dep-leak/plugin-dep-leak/0.1.0-SNAPSHOT master*
❯ cat plugin-dep-leak-0.1.0-SNAPSHOT.pom | grep ultra
Otann commented 7 years ago

Changed ultra to humane-test-output. And ultra should go to :user profile anyway ;) Released 0.2.7

$ boot -d morse show -d
Retrieving morse-0.2.6.pom from https://repo.clojars.org/ (3k)
Retrieving morse-0.2.6.jar from https://repo.clojars.org/ (14k)
Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.4.0
[morse "0.2.6"]
├── [cheshire "5.5.0"]
│   ├── [com.fasterxml.jackson.core/jackson-core "2.5.3"]
│   ├── [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.5.3"]
│   ├── [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.5.3"]
│   └── [tigris "0.1.1"]
├── [clj-http "2.1.0"]
│   ├── [commons-codec "1.10" :exclusions [[org.clojure/clojure]]]
│   ├── [commons-io "2.4" :exclusions [[org.clojure/clojure]]]
│   ├── [org.apache.httpcomponents/httpclient "4.5.1" :exclusions [[org.clojure/clojure]]]
│   │   └── [commons-logging "1.2"]
│   ├── [org.apache.httpcomponents/httpcore "4.4.4" :exclusions [[org.clojure/clojure]]]
│   ├── [org.apache.httpcomponents/httpmime "4.5.1" :exclusions [[org.clojure/clojure]]]
│   ├── [potemkin "0.4.3" :exclusions [[org.clojure/clojure]]]
│   │   ├── [clj-tuple "0.2.2"]
│   │   └── [riddley "0.1.12"]
│   └── [slingshot "0.12.2" :exclusions [[org.clojure/clojure]]]
├── [clj-stacktrace "0.2.8"]
├── [org.clojure/core.async "0.2.374"]
│   └── [org.clojure/tools.analyzer.jvm "0.6.9"]
│       ├── [org.clojure/core.memoize "0.5.8"]
│       │   └── [org.clojure/core.cache "0.6.4"]
│       │       └── [org.clojure/data.priority-map "0.0.4"]
│       ├── [org.clojure/tools.analyzer "0.6.7"]
│       ├── [org.clojure/tools.reader "1.0.0-alpha1"]
│       └── [org.ow2.asm/asm-all "4.2"]
├── [org.clojure/tools.logging "0.3.1"]
└── [org.clojure/tools.macro "0.1.5"]
    └── [org.clojure/clojure "1.4.0"]
martinklepsch commented 7 years ago

Awesome, thank you very much! 👍