-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
tools.nrepl cannot be specified effectively as a maven dependency. #1569
Comments
I second this with #1593 (already closed). For a hacky workaround in the upstream project (where we do "lein pom"), add the following to {:profiles {:base {:dependencies ^:replace []}}} Suggestion:
|
@pw4ever The solution isn't to drop the test scope, it's to only apply the test scope if it appears in base but not elsewhere. Happy to take a patch for this. |
@technomancy Marking :dev and :test dependencies as "test" scope is understandable. But could you clarify the logic of marking :base dependencies in test scope since it is not empty by default? I believe a proper solution is to de-duplicate Maven coordinates before generating POM's xml mark-up. If so, what would you suggest as a proper de-duplication logic? |
The :base profile is semantically equivalent to :dev, except it's for things that are included with Leiningen by default rather than specified by the project. Just adding a |
@technomancy Thanks for the clarification. That makes sense. Just to be clear, you mean change the for on https://github.com/technomancy/leiningen/blob/2.4.2/src/leiningen/pom.clj#L328 (for [profile [:dev :test :base]
dep (:dependencies (profile profiles))
:when (not (contains? (->> (:dependencies project)
(map first)
set)
dep)) ]
(make-scope "test" dep)) to slightly abuse the fact that artifact/id is "first" of the dep vector? I think the proper de-duplication is on artifact/id rather than the whole dep vector. |
Oh, hmmm... yeah I hadn't considered this, but technically the |
@technomancy I guess, in this case, explicitly specified dep in project should override implicit ones 'cause we do not want the final pom.xml to have 2 entries of the same dependency---my understanding is that the latter one will replace, rather than add to, the earlier ones in POM semantics. |
Well, an alternative hack without touching lein update-in :profiles:base empty -- update-in :profiles:base vec -- pom Replace |
Lein appears to be injected tools.nrepl (and complete) into the dependency tree.
For instance gives:
Not a huge problem in and off itself, but it causes problems when a pom is produced and nrepl really is a dependency. So for example:
gives a pom.xml with the following dependencies.
Unfortunately, the tools.nrepl dependency which appears first appears to be overwritten by the second occurrence and that is scoped to test. So no tools.nrepl dependency gets into the pom.xml -- anything using this artifact is then going to crash, unless it gets tools.nrepl from elsewhere.
The text was updated successfully, but these errors were encountered: