Fork me on GitHub

but if a plugin has middleware that adds to your dependencies collection, does it make a difference then?


Hey… Just seen your questions about :middleware adding dependencies etc… FWIW I went through this recently when writing the lein-tools-deps plugin: Plugins can add :dependencies themselves, we do it with lein-tools-deps, though tools.deps typically fetches them and installs them into .m2 so leiningen won’t usually fetch them again (though I believe it would if it didn’t find). For reference - most leiningen tasks are implemented as plugins, and some add :dependencies too. e.g. lein repl: Note they define a profile internally which allows a user the ability to override the plugins deps if they need to specify a different version etc to resolve a conflict. Hope this helps.


oh I forgot about the internal profile trick -- I wonder if that's the way to keep the deps out of prod


e.g., if the profile only gets added for specific tasks


I'm not sure that's doable if it's an existing task though, like repl or run


yeah if it’s an existing task you might need to do something else… though you may with middleware be able to override their internal profile from your plugin… don’t know though.


I’m not sure how good an idea it is for a plug-in to add dependencies when they haven’t been asked for, for this kind of reason


If I run the lein-localrepo plugin via lein with-profile I get an error about a suppressed exit, flipping on the DEBUG envvar I found out it’s because lein-localrepo calls (main/exit 0) itself.


Is there a way to fix this without modifying lein-localrepo itself?


This seem like an issue with lein-localrepo, for completeness:


$ lein help install
Install jar and pom to the local repository; typically ~/.m2.
Does anyone know if there is more documentation on this somewhere? Specifically, what might cause “the local repository” to not be ~/.m2? It’s installing the jar to the project directory instead and I can’t figure out why.


there is a project prop called :local-repo, sounds like you may have it set to a non-default?


Do you have a ~/profiles.clj doing this perhaps, if not your project.clj of your current project


@mikerod I don’t have that set in either of the places I know to look:

$ grep local-repo project.clj
$ grep local-repo ~/.lein/profiles.clj


@enn what does lein prrint say for it


@mikerod weird, :local-repo is not in the list of properties output by pprint


@enn well, it is normal to install the project artifacts to /target of the current project (or whatever you have your output/target dir configured to)


But it should also be putting the artifacts in ~/.m2. Are you sure that is not what is happening?


maybe … is it also normal to put pom.xml in the project root? (not target)


It doesn’t appear to be installing in ~/.m2 anymore although it was last week. Now when I run lein install the old remains in ~/.m2.


I deleted the older install under ~/.m2 and ran lein install again and it was not replaced.


> maybe … is it also normal to put pom.xml in the project root? (not target) yes


is it a SNAPSHOT version


it’ll install with different timestamps each time then


if it is a fixed version, it won’t auto replace it I don’t think


it is a snapshot version


regardless of auto replace shouldn’t it have installed it under ~/.m2 after I deleted it?


@enn can you share your whole project.clj?


ah, I think I figured it out. I knew it would be something stupid. I had added a namespace and was looking at the old un-namespaced jar under ~/.m2.