There was a good reason we couldn't support this in earlier versions
of Leiningen, but it escapes me now. Perhaps it doesn't work on old
JDKs or there are platform-specific issues or something?
This is accomplished with the :reduce metadata, which specifies the
reduce function to use when merging. This allows us to merge
dependencies and repositories deeply like other structures. Note that
dependencies are transformed into a map before they are merged and then
transformed back into a vector.
Also change the way that collections are merged. They used to be merged
by taking the right collection and prepending it to the left collection.
This behavior was needed for :*-paths in defproject, but it is not an
obvious default. Now, the default is to append the right collection, but
the :prepend metadata can be used to tell meta-merge to prepend instead.
By default, :source-paths, :resource-paths and :test-paths have :prepend
set to true.
This is a list of all named profiles that have been merged in, after
following composite profile. This is different from :included-profiles
which is the list of profiles before composite profiles have been
expanded.
* namespaced keywords to control lookup of credentials in env vars
* using a vector to define a number of credential sources to be checked in series
(gh-768)
Showing every failed repo lookup is bad for users.
They see the failure and get confused.
Hook up a custom listener that has the following behavior:
1. success -> print out artifact name, size, and repository name
2. failure -> ignore unless it is the last repo, then print out failure
message with artifact name.
Fixes#610.
use concat instead of merge to merge values, :plugin-repositories and :repositories are lists again
with merge you will end up with a value for :repositories like [[repo {:url url}] ([pluginrepo {:url url}])]
instead of [[repo {:url url}] [pluginrepo {:url url}]]
On some platforms, eg. Mac, it may be more desirable to use an executable other
than 'gpg' for signing and encryption, and it may not be possible to symlink to
'gpg'. This allows the gpg executable used in lein to be specified via LEIN_GPG.
You can use ~/.lein/leinrc or ~/.leinrc to set LEIN_GPG by adding
'export LEIN_GPG=your-gpg' to either of those files.
On a coworker's Mac, the default file encoding was apparently
MacRoman. The -Dfile.encoding=UTF-8 that's in the lein shell script
wasn't being propogated to subprocesses which caused rage and the
replacement character.
Don't call set-profiles from leiningen.core.project/read because it
calls load-middleware, and we want to wait to do that for the first time
in init-project. To solve this, I added init-profiles which is called by
both read and set-profiles.
Also clean up init-project and move code duplicated in set-profiles into
activate-middleware. We now always load hooks and certificates when
activating middleware, and load-certificates is actually called twice in
the course of init-project. To make sure load-certificates is
idempotent, we memoized leiningen.core.ssl/register-scheme.
Both now expect a full var, though hooks will fall back to activate in
the provided namespace for compatibility.
Also, use the following convention for plugin auto hooks and middleware:
- Assuming your plugin is called lein-config
- Put hooks you want auto-loaded in lein-config.plugin/hooks
- Put middleware you want auto-applied in lein-config.plugin/middleware
Previously, you could not unmerge composite profiles. So, if the
currently active profiles were [:default], which is a composite of
[:dev :user :base], then (unmerge-profiles project :dev) would do
nothing. To fix this, we have to keep track of both :included-profiles
and :excluded-profiles.
I also combined apply-profiles and reset-profiles into a single function
called reset-profiles with an optional excluded-profiles argument and
renamed apply-profiles-raw to apply-profiles.
Any dependency marked with :ext true will be loaded by the ext class loader.
Libraries with native dependencies (e.g. tokyocabinet) need to be loaded by
the ext classloader, because native libraries can only be loaded once per
JVM. Also, most SQL libraries (e.g. postgresql) need to be in the ext class
loader because java.sql.DriverManager holds onto the class.
Use 0.6.6 classlojure's alter-java-library-path! to set java.library.path
at runtime.
Perhaps we should be setting all of these system properties back after
we are done, including this one?
This can happen in merge-profiles, unmerge-profiles or in the newly
added reset-profiles. All three rebuild the project map from scratch
using `(:without-profiles (meta project))`. This prevents middleware
from being applied twice to the same project map.
We also have to call apply-middleware explicitly in init-project because
we want to load-plugins before applying middleware in this case only. An
alternative would be to load plugins every time project profiles are
modified. @technomancy, what do you think of that option?
Issue #401
Conflicts:
leiningen-core/src/leiningen/core/main.clj
src/leiningen/pom.clj
The new certificate is trusted by Oracle JVMs by default but there
are still some users with JVMs that don't have any default root certs
at all. The FreeBSD OpenJDK packages are apparently one such example.
You can now overide :default in your project.clj to change what profiles are
active when none are specified. As part of this change, default is no longer
used to for built-in settings; these are now stored in the :base profile.
This makes it possible to override :default while still including the :base
profile.
if a profile value is a vector, then combine the values using
combine-profiles. this allows you to remove duplication by putting
shared configuration in "base" profiles.
This is helps people coming from the Java world. "java" accepts -help
and -version, and neither --help nor --version. With this commit,
Leiningen accepts long names with either single or double dashes.