-
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
Uberjar applies dev/user profiles #537
Comments
The fact that the |
Okay, in fact I placed my libs at first in the {:user {:dependencies […]}}, but this resulted in including them into my Überjars, and not just into dev time. Then I talked to several people, who suggested to try it with profiles.clj==>:dev. You can place any arbitrary defproject entries into a given profile and they will be merged into the project map when that profile is active. In addition to project.clj, profiles specified in ~/.lein/profiles.clj will be available in all projects. ==> You can place any arbitrary defproject entries into a given profile and they will be merged into the project map when that profile is active. In addition to project.clj, profiles specified in ~/.lein/profiles.clj will be available in all projects. Be aware however that profiles specified in ~/.lein/profiles.clj will be overridden by profiles specified in a project.clj file. For example, if you specify :dependencies in the :dev profile in your ~/.lein/profiles.clj and also specify :dependencies in your project.clj file, then only the one from the latter will be used. And The difference between the profiles active by default is that the :default profile comes with Leiningen, while the :dev profile is meant to be specified in project.clj and the :user plugin goes in your ~/.lein/profiles.clj file. could get the addition What you specify in the :user profile in your ~/.lein/profiles.clj file is treated as if it were specified in your project.clj under the :dev profile. If you want to access dependencies during development time for any project place them in your :user profile. Something like that maybe, might help. Just a suggestion of course. |
Thanks; incorporated some of these suggestions into the readme. |
Re-opening as a reminder to verify that the test dependencies still make it in the uberjar'ed pom. Another way to solve this is by moving the pom task's project manipulation to include the snapshot check. See https://github.com/technomancy/leiningen/blob/master/src/leiningen/pom.clj#L312 |
Looks like d85f2fb causes a broken pom into the jar. The pom task tries to manipulate the profiles itself, and since it's passed a project that no longer contains a :without-profiles meta it loses a bunch of data. Also I'm pretty sure that the pom task needs to get the project with profiles added. If there is a project with
then |
A better example where the classifier is useful might be a project with legacy 1.2/contrib support in a separate jar with a clj1.2 classifier. |
I was confused on classifiers. They can't be used to specify different dependency versions. |
Via Leiningen 2 I would like to have several useful libs as global dev dependencies, for example Criterium for benchmarking, or Pomegranate, so that I can add interesting libs during runtime. I was not successful so far. I show how to reproduce what I did:
Make a directory temp and paste this project.clj there:
Backup your profiles.clj and replace it with this one:
Now
lein pprint
shows me that Criterium is a dependency, and I have it available inlein swank
. Building an Überjar however won’t work, and I get the message thatSo it seems Leiningen wants to add Criterium as a regular dependency, and not just for dev time. This is my first finding.
The second one is this: change the project.clj file to:
Now a
lein pprint
confirms that Criterium just got killed. It seems my :dev profile from myprofiles.clj
got overwritten by the direct entry in theproject.clj
file.Was my intuition right, that global dev dependencies should go into profiles.clj under the :dev profile?
If yes it seems that there are two bugs:
The text was updated successfully, but these errors were encountered: