This file is indexed.

/usr/share/doc/libpomegranate-clojure/html/README.html is in libpomegranate-clojure 0.2.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Pomegranate</title>
</head>
<body>
<h1>Pomegranate  <a href="http://travis-ci.org/#!/cemerick/pomegranate/builds"><img src="https://secure.travis-ci.org/cemerick/pomegranate.png" alt="Travis CI status" /></a></h1>

<p><a href="http://github.com/cemerick/pomegranate">Pomegranate</a> is a library that provides:</p>

<ol>
<li>A sane Clojure API for Sonatype <a href="https://github.com/sonatype/sonatype-aether">Aether</a>.</li>
<li><p>A re-implementation of <a href="http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/add-classpath"><code>add-classpath</code></a> (deprecated in Clojure core) that:</p>

<ul>
<li>is a little more comprehensive than core's <code>add-classpath</code> — it should work as expected in more circumstances, and</li>
<li>optionally uses Aether to add a Maven artifact (and all of its transitive dependencies) to your Clojure runtime's classpath dynamically.</li>
</ul></li>
</ol>

<p>Insofar as most useful Clojure libraries have dependencies, any reasonable implementation of the <code>add-classpath</code> concept must seamlessly support resolving those dependencies IMO.</p>

<h2>"Installation"</h2>

<p>Pomegranate is available in Maven central.  Add it to your Leiningen <code>project.clj</code>:</p>

<p><code>clojure
[com.cemerick/pomegranate "0.2.0"]
</code></p>

<p>or to your Maven project's <code>pom.xml</code>:</p>

<p><code>xml
&lt;dependency&gt;
  &lt;groupId&gt;com.cemerick&lt;/groupId&gt;
  &lt;artifactId&gt;pomegranate&lt;/artifactId&gt;
  &lt;version&gt;0.2.0&lt;/version&gt;
&lt;/dependency&gt;
</code></p>

<h2><code>add-classpath</code> usage</h2>

<p>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 <a href="http://github.com/clojure/tools.nrepl">nREPL</a>.  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:</p>

<ol>
<li>Dump the data to disk via <code>pr</code> (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.</li>
<li>There is no second choice.  You <em>could</em> use <code>add-claspath</code>, but the library you want has 12 bajillion dependencies, and there's no way you're going to hunt them down manually.</li>
</ol>

<p>Let's say we want to use <a href="https://github.com/liebke/incanter">Incanter</a> (which has roughly 40 dependencies — far too many for us to reasonably locate and add via <code>add-classpath</code> manually):</p>

<p>```clojure
=> (require '(incanter core stats charts))</p>

<h1><CompilerException java.io.FileNotFoundException:</h1>

<p>Could not locate incanter/core__init.class or incanter/core.clj on classpath:  (NO_SOURCE_FILE:0)>
```</p>

<p>Looks bleak. Assuming you've got Pomegranate on your classpath already, you can do this though:</p>

<p><code>clojure
=&gt; (use '[cemerick.pomegranate :only (add-dependencies)])
nil
=&gt; (add-dependencies :coordinates '[[incanter "1.2.3"]]
                     :repositories (merge cemerick.pomegranate.aether/maven-central
                                          {"clojars" "http://clojars.org/repo"}))
;...add-dependencies returns full dependency graph...
=&gt; (require '(incanter core stats charts))
nil
</code></p>

<p>Now you can analyze and chart away, Incanter having been added to your runtime.  Note that <code>add-dependencies</code> may crunch along for a while — it may need to download dependencies, so you're waiting on the network.  All resolved dependencies are stored in the default local repository (<code>~/.m2/repository</code>), and if they are found there, then they are not downloaded.</p>

<p>The arguments to <code>add-dependencies</code> look like Leiningen-style notation, and they are.</p>

<p>Please note that <strong>there are a number of scenarios in which <code>add-dependencies</code> will not work, or
will not work as you'd expect</strong>.  Many of these are due to the nature of JVM classloaders
(e.g. adding jars containing conflicting versions of a particular dependency will rarely
end well), which Pomegranate does not currently attempt to hide.  Thus, <code>add-classpath</code> and
<code>add-dependencies</code> should be considered escape hatches to be used when necessary, rather than
a regular part of your development workflow.</p>

<h2>Status of Aether support</h2>

<p>Pomegranate is being used by <a href="http://leiningen.org">Leiningen v2.x</a> 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
abstractions and conventions.</p>

<h4>Supported features</h4>

<ul>
<li>dependency resolution
** common dependency graph/hierarchy manipulation ops</li>
<li>local installation</li>
<li>remote deployment</li>
<li>repository authentication for all of the above</li>
<li>HTTP proxy configuration</li>
<li>offline mode</li>
<li>transfer listeners (with a sane Clojure fn veneer)</li>
</ul>

<h4>Not there yet</h4>

<ul>
<li>repository listeners</li>
<li>mirror support</li>
<li>options to retrieve a single artifact (e.g. for obtaining
source/javadoc)</li>
<li>tests; there's halfway decent coverage, but nowhere near the kind of comprehensive combinatorial testing that maven dependency resolution demands</li>
</ul>

<h2>Changelog</h2>

<p>See the <code>CHANGES.md</code> file at the top level of the repo.</p>

<h2>Need Help?</h2>

<p>Ping <code>cemerick</code> on freenode irc or twitter if you have questions
or would like to contribute patches.</p>

<h2>License</h2>

<p>Copyright © 2011-2012 <a href="http://cemerick.com">Chas Emerick</a> and all other
contributors.</p>

<p>Licensed under the EPL. (See the file epl-v10.html.)</p>
</body>
</html>