• Stars
    star
    255
  • Rank 159,691 (Top 4 %)
  • Language
    Clojure
  • Created over 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library for distilling (resolving and adding to the classpath) dependencies

alembic

Repository ยท Issues ยท API docs ยท Annotated source ยท Release Notes

Alembic is a clojure library that allows you to distill jars onto your classpath in a running JVM instance. You can use it to add dependencies to a running REPL, either in an ad-hoc fashion, or by reloading your project.clj file.

You can also use it to reload your project.clj file and invoke leiningen tasks.

It uses leiningen and pomegranate to resolve the jars, classlojure to isolate leiningen and its dependencies, and dynapath to modify the classpath.

This means you can use lein and pomegranate without their dependencies interfering with your project classpath. The only dependencies added are classlojure and dynapath - both small libraries with no transitive dependencies.

Project Dependency

To use Alembic with nREPL or any other clojure REPL, you will need to add Alembic to you development dependencies. For a leiningen based project, you can do this by adding it to the :dependencies vector of the :dev profile in project.clj.

:profiles {:dev {:dependencies [[alembic "0.3.2"]]}}

You can enable Alembic on all you projects, by adding it to the :dependencies vector of the :user profile in ~/.lein/profiles.clj.

Usage

Reloading project.clj

If you modify the dependencies in your project.clj file, you can load the modified dependencies with load-project.

This will add all non-conflicting dependency changes. Only new dependencies are considered non-conflicting. New versions of existing dependencies are not loaded. Removed dependencies are not unloaded.

Adding Ad-Hoc Dependencies

To add a dependency to the classpath, use the distill function, passing a leiningen style dependency vector.

(alembic.still/distill '[org.clojure/tools.logging "0.3.2"])

You can pass a sequence of dependencies to add, or just a single dependency as in the example above.

distill prints the dependencies added to the classpath, and those not added due to conflicts.

The distill function returns with no side-effects, if the dependency's jars are already on the classpath.

By default, distill uses the repositories in the current lein project. You can override this by passing a map of lein style repository information to the :repositories option. The project-repositories function can be used to obtain the lein project repositories, should you want to adapt these to pass as an :repositories argument.

For programmatic use, distill* returns a sequence of maps, where each map represents a dependent jar. Those jars without a current version on the classpath will be added to the classpath. The jars with a version already on the classpath are not added to the classpath, and the currently loaded version is reported on the :current-version key.

You can query the dependencies that have been added with the dependencies-added function, which returns a sequence of leiningen style dependency vectors.

You can lookup the dependency jars for the distilled dependencies, using the dependency-jars function.

The conflicting-versions function returns a sequence of dependencies for a distilled dependency, where the dependency jar version doesn't match the version currently on the classpath.

Invoking Leiningen Tasks

The lein macro invokes leiningen. For example, to show your project's dependency tree, you could run:

(alembic.still/lein deps :tree)

The macro allows you to invoke tasks without passing string arguments. If you need to call lein functionally, use the lein* function instead.

Configuring User Profile with Injections

You can reduce the amount of typing you need to use alembic by using the lein-shorthand plugin and configuring your :user profile in ~/.lein/profiles.clj.

{:user
  {:dependencies [[alembic "0.3.2"]]
   :plugins [[com.palletops/lein-shorthand "0.4.0"]]
   :shorthand {. [alembic.still/distill alembic.still/lein]}}}

This will define the . namespace, so you can run (./lein deps :tree).

Support and Discussion

Discussion of alembic, either on the clojure-tools google group, or on #clojure or #pallet on freenode IRC.

License

Copyright ยฉ 2013 Hugo Duncan

Distributed under the Eclipse Public License.

More Repositories

1

pallet

Automates controlling and provisioning cloud server instances. DevOps for the JVM.
Clojure
807
star
2

ritz

SWANK and nREPL servers for clojure providing JPDA based debuggers
Common Lisp
320
star
3

stevedore

A shell script embedding in clojure
Clojure
93
star
4

thread-expr

Macros for working with clojure argument threading
Clojure
40
star
5

pallet-hadoop

Hadoop Cluster Management with Intelligent Defaults
Clojure
40
star
6

zi

Maven plugin for clojure
Clojure
37
star
7

pallet-vmfest

Pallet provider for using vmfest
Clojure
35
star
8

lein-set-version

Set the version in your project.clj file
Clojure
34
star
9

pallet-docker

A pallet provider for docker containers
Clojure
33
star
10

pallet-hadoop-example

Examples of running hadoop clusters with pallet
Clojure
24
star
11

lein-sha-version

A Leiningen plugin to set the project version based on the git SHA
Clojure
17
star
12

pallet-lein

A leiningen plugin for running pallet tasks
Clojure
12
star
13

example-deploy-webapp

An example of deploying using the app-deploy-crate, using a demo webapp project
Clojure
12
star
14

pallet.github.com

Pallet's main page
CSS
11
star
15

pallet-fsm

Finite State Machine library
Clojure
10
star
16

clojure-maven

Components for using clojure in maven
Clojure
9
star
17

pallet-aws

A pallet provider for AWS, based on the Amazon java SDK
Clojure
8
star
18

learn-pallet

Learn pallet via live-coding!
Clojure
8
star
19

vmfest-playground

A playground to test VMFest
Clojure
8
star
20

riemann-crate

Palelt crate for installing and configuring riemann
Clojure
7
star
21

pallet-fsmop

A finite state machine composition library.
Clojure
7
star
22

zi-cljs

A maven plugin for compiling ClojureScript
Clojure
7
star
23

pallet-thread

A library to simplify working with Java threads from clojure.
Clojure
7
star
24

awaze

A clojure library for Amazon AWS using the AWS Java SDK
Clojure
6
star
25

chiba

Plugin discovery and loading
Clojure
6
star
26

clj-jclouds

A clojure API for jclouds
Clojure
6
star
27

pallet-lein-new

Pallet project templates for lein newnew
Clojure
6
star
28

postgres-crate

postgres pallet crate
Clojure
6
star
29

lein-jdk-tools

Leiningen plugin to add tools.jar and sa-jdi.jar to the classpath
Clojure
5
star
30

pallet-jclouds

Pallet provider for using jclouds
Clojure
5
star
31

docker-crate

Crate for installing and running docker
Clojure
5
star
32

nginx-crate

nginx pallet crate
Clojure
5
star
33

pallet-map-merge

A library to allow merging of clojure maps using per-key merge policies.
Clojure
4
star
34

lein-dist

Package a leiningen project into a distribution tar file
Clojure
4
star
35

little-fluffy-cloud

The most minimalistic cloud provider that will fit in your laptop
4
star
36

pallet-repl

Library to facilitate use of pallet at the REPL
Clojure
4
star
37

pallet-apache-crates

Pallet crates for Apache projects
Clojure
4
star
38

lein-aot-filter

A leiningen plugin to filter AOT compiled class files
Clojure
4
star
39

app-deploy-crate

A pallet crate to deploy and control applications
Clojure
4
star
40

ssh-transport

Library for execution of scripts over SSH, for pallet
Clojure
3
star
41

cli-cmds

Library for building clojure CLI commands with sub-commands
Clojure
3
star
42

common

common functions used across pallet projects
Clojure
3
star
43

cassandra-crate

cassandra pallet crate
Clojure
3
star
44

pallet-jruby

Pallet JRuby Gem
Ruby
3
star
45

java-crate

java pallet crate
Clojure
3
star
46

ruby-crate

ruby pallet crate
Clojure
3
star
47

hudson-crate

hudson pallet crate
Clojure
3
star
48

runit-crate

Clojure
3
star
49

lein-as-resource

Provides a lein uberjar inside a jar-file
Clojure
2
star
50

lein-maven

Lein plugin for working with maven poms
Clojure
2
star
51

ssh-crate

ssh pallet crate
Clojure
2
star
52

jetty-crate

jetty pallet crate
Clojure
2
star
53

jenkins-crate

jenkins crate
Clojure
2
star
54

gpg-crate

gpg pallet crate
Clojure
2
star
55

script-exec

script execution
Clojure
2
star
56

hadoop-crate

A crate for Hadoop
Clojure
2
star
57

splunk-crate

splunk pallet crate
Clojure
2
star
58

mongodb-crate

A Crate for installing, configuring and managing MongoDB
Clojure
2
star
59

node-js-crate

node-js pallet crate
Clojure
2
star
60

pallet-crate

Clojure
2
star
61

upstart-crate

upstart pallet crate
Clojure
2
star
62

wordpress-crate

wordpress pallet crate
Clojure
2
star
63

zeromq-crate

zeromq pallet crate
Clojure
2
star
64

haproxy-crate

haproxy pallet crate
Clojure
2
star
65

bridle

data structure checking
Clojure
2
star
66

mysql-crate

mysql pallet crate
Clojure
2
star
67

couchdb-crate

couchdb pallet crate
Clojure
2
star
68

crates

Pallet crates
Clojure
1
star
69

monit-crate

monit pallet crate
Clojure
1
star
70

local-transport

Execution of scripts locally, for pallet
Clojure
1
star
71

bzr-crate

bzr pallet crate
Clojure
1
star
72

cloudkick-crate

cloudkick pallet crate
Clojure
1
star
73

maven-embedder

Embed maven
Clojure
1
star
74

iptables-crate

iptables pallet crate
Clojure
1
star
75

ganglia-crate

ganglia pallet crate
Clojure
1
star
76

chef-crate

chef pallet crate
Clojure
1
star
77

learn-pallet-web

The learn-pallet.com website
JavaScript
1
star
78

vblob-crate

Pallet crate for installing and configuring vblob
Clojure
1
star
79

rubygems-crate

rubygems pallet crate
Clojure
1
star
80

php-crate

php pallet crate
Clojure
1
star
81

pallet-crates-test

Test pom for crates
1
star
82

syslog-ng-crate

syslog-ng pallet crate
Clojure
1
star
83

lein-crate

Pallet crate for installing and configuring leiningen
Clojure
1
star
84

gretel

Sane error handling in Clojure
Clojure
1
star
85

rabbitmq-crate

rabbitmq pallet crate
Clojure
1
star
86

pallet-settings-xml

settings.xml for use in building pallet.projects
1
star
87

cruise-control-rb-crate

cruise-control-rb pallet crate
Clojure
1
star
88

forever-crate

Pallet crate for installing forever
Clojure
1
star
89

lein-pallet-crate

A leiningen plugin to help document pallet crates
Clojure
1
star
90

public-dns-if-no-nameserver-crate

public-dns-if-no-nameserver pallet crate
Clojure
1
star
91

sphinx-crate

sphinx pallet crate
Clojure
1
star
92

github-crate

github pallet crate
Clojure
1
star
93

pallet-aws-ops

Basic operations on AWS
Clojure
1
star
94

cinderella-crate

Pallet crate for installing and configuring cinderella
Clojure
1
star
95

devbox-crate

A crate to create the basis for a development node
Clojure
1
star
96

zookeeper-crate

zookeeper pallet crate
Clojure
1
star
97

postfix-crate

postfix pallet crate
Clojure
1
star
98

squid-crate

squid pallet crate
Clojure
1
star
99

pallet-all

Unifying dependency for pallet and pallet-crates
1
star
100

parent-pom

Parent pom for pallet projects pushed to sonatype
Shell
1
star