Skip to content

Commit

Permalink
Merge pull request #83 from technomancy/upgrade-aether
Browse files Browse the repository at this point in the history
Upgrade aether
  • Loading branch information
cemerick authored May 19, 2017
2 parents 51ecddf + 12d35ca commit 69b7d03
Show file tree
Hide file tree
Showing 10 changed files with 276 additions and 169 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ install: mvn install --quiet -DskipTests=true
script: mvn test
jdk:
- openjdk7
- openjdk6
- oraclejdk7
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Pomegranate [![Travis CI status](https://secure.travis-ci.org/cemerick/pomegranate.png)](http://travis-ci.org/#!/cemerick/pomegranate/builds)
# Pomegranate [![Travis CI status](https://secure.travis-ci.org/cemerick/pomegranate.png)](https://travis-ci.org/cemerick/pomegranate/builds)

[Pomegranate](http://github.com/cemerick/pomegranate) is a library that provides:
[Pomegranate](https://github.com/cemerick/pomegranate) is a library that provides:

1. A sane Clojure API for Sonatype [Aether](https://github.com/sonatype/sonatype-aether).
2. A re-implementation of [`add-classpath`](http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/add-classpath) (deprecated in Clojure core) that:
2. A re-implementation of [`add-classpath`](https://clojure.github.com/clojure/clojure.core-api.html#clojure.core/add-classpath) (deprecated in Clojure core) that:

* is a little more comprehensive than core's `add-classpath` — it should work as expected in more circumstances, and
* optionally uses Aether to add a Maven artifact (and all of its transitive dependencies) to your Clojure runtime's classpath dynamically.
Expand All @@ -30,7 +30,7 @@ or to your Maven project's `pom.xml`:

## `add-classpath` usage

Just to set a stage: you're at the REPL, and you've got some useful data that you'd like to munge and analyze in various ways. Maybe it's something you've generated locally, maybe it's data on a production machine and you're logged in via [nREPL](http://github.com/clojure/tools.nrepl). In any case, you'd like to work with the data, but realize that you don't have the libraries you need do what you want. Your choices at this point are:
Just to set a stage: you're at the REPL, and you've got some useful data that you'd like to munge and analyze in various ways. Maybe it's something you've generated locally, maybe it's data on a production machine and you're logged in via [nREPL](https://github.com/clojure/tools.nrepl). In any case, you'd like to work with the data, but realize that you don't have the libraries you need do what you want. Your choices at this point are:

1. Dump the data to disk via `pr` (assuming it's just Clojure data structures!), and start up a new Clojure process with the appropriate libraries on the classpath. This can really suck if the data is in a remote environment.
2. There is no second choice. You _could_ use `add-claspath`, but the library you want has 12 bajillion dependencies, and there's no way you're going to hunt them down manually.
Expand All @@ -50,7 +50,7 @@ Looks bleak. Assuming you've got Pomegranate on your classpath already, you can
nil
=> (add-dependencies :coordinates '[[incanter "1.2.3"]]
:repositories (merge cemerick.pomegranate.aether/maven-central
{"clojars" "http://clojars.org/repo"}))
{"clojars" "https://clojars.org/repo"}))
;...add-dependencies returns full dependency graph...
=> (require '(incanter core stats charts))
nil
Expand All @@ -69,7 +69,7 @@ a regular part of your development workflow.

## Status of Aether support

Pomegranate is being used by [Leiningen v2.x](http://leiningen.org) as
Pomegranate is being used by [Leiningen v2.x](https://leiningen.org) as
its sole dependency resolution library. This has prompted rapid
maturation of the scope and quality of Aether support. That said,
specific API points remain subject to change as we find the right
Expand Down Expand Up @@ -105,7 +105,7 @@ or would like to contribute patches.

## License

Copyright © 2011-2012 [Chas Emerick](http://cemerick.com) and all other
Copyright © 2011-2017 [Chas Emerick](https://cemerick.com) and all other
contributors.

Licensed under the EPL. (See the file epl-v10.html.)
64 changes: 32 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cemerick</groupId>
<artifactId>pomegranate</artifactId>
<version>0.3.2-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<name>pomegranate</name>
<description />
<url>http://github.com/cemerick/pomegranate</url>
Expand Down Expand Up @@ -30,55 +30,42 @@

<properties>
<clojure.version>1.3.0</clojure.version>

<aetherVersion>1.13.1</aetherVersion>
<mavenVersion>3.0.4</mavenVersion>
<wagonVersion>2.2</wagonVersion>
<mavenVersion>3.5.0</mavenVersion>
<resolverVersion>1.0.3</resolverVersion>
<wagonVersion>2.12</wagonVersion>
</properties>

<dependencies>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-util</artifactId>
<version>${aetherVersion}</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>${aetherVersion}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-file</artifactId>
<version>${aetherVersion}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<version>${aetherVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>${mavenVersion}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.tcrawley</groupId>
<artifactId>dynapath</artifactId>
<version>0.2.5</version>
</dependency>

<!-- wagons for dependency resolution -->
<dependency>
<groupId>org.apache.maven.wagon</groupId>
Expand All @@ -96,6 +83,19 @@
<version>${wagonVersion}</version>
<optional>true</optional>
</dependency>
<!-- otherwise we get an earlier version that is missing the needed
org.apache.http.conn.HttpClientConnectionManager class -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.22</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/cemerick/pomegranate.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(add-dependencies :coordinates '[[incanter \"1.2.3\"]]
:repositories (merge cemerick.pomegranate.aether/maven-central
{\"clojars\" \"http://clojars.org/repo\"}))
{\"clojars\" \"https://clojars.org/repo\"}))
Note that Maven central is used as the sole repository if none are specified.
If :repositories are provided, then you must merge in the `maven-central` map from
Expand Down
Loading

0 comments on commit 69b7d03

Please sign in to comment.