Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Clojure Documentation
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
Colour
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Undo
Redo
Keyboard Shortcuts Help
<p>Many different build tools and Java IDEs use public Maven repositories to download dependencies. This page lists the Maven repositories where Clojure and contributed libraries may be found, and how to configure them in different build tools.</p><h1>Leiningen Quick Start</h1><p>To use Clojure and contrib library <strong>releases</strong> in your Leiningen project, there's nothing special to do. Just add dependencies in project.clj</p><p>To use Clojure and contrib library <strong>SNAPSHOTS</strong> in your Leiningen project, add the following to your project.clj:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>:repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}</pre></td></tr></table><p> </p><h1>A note about releases versus snapshots</h1><p>Maven repositories distinguish between <strong>releases</strong> and <strong>snapshots</strong>.</p><p><strong>Releases</strong> have fixed version strings, like <strong>1.2.0</strong> or <strong>1.3.0-alpha5</strong>. Once it has been uploaded to a public repository, a release never changes.</p><p><strong>Snapshots</strong> have version strings ending in <strong>-SNAPSHOT</strong>. Typically, snapshot version strings look like <strong>1.1.0-SNAPSHOT</strong>, although Clojure the language adds the name of the git branch, like <strong>1.3.0-master-SNAPSHOT</strong>. Snapshots are like tracking the latest version of a project in source control: they can change.</p><p>When a snapshot is uploaded to a public Maven repository, the <strong>-SNAPSHOT</strong> in the version string is replaced with a unique timestamp, so <strong>1.3.0-master-SNAPSHOT</strong> would become something like <strong>1.3.0-master-20110408.150223-52</strong>.</p><p>If you use a <strong>-SNAPSHOT</strong> version in your project dependencies, most Maven-based tools will automatically check for updated versions of that snapshot. (Maven itself allows you to disable this behavior with the <strong>-o</strong> option.) To pin your dependency at a specific snapshot version, use the full version string with the timestamp.</p><h1>Clojure & Contrib library releases</h1><p>New snapshots and releases are uploaded to the Sonatype open-source repository at <a class="external-link" href="https://oss.sonatype.org/content/groups/public/" rel="nofollow">https://oss.sonatype.org/content/groups/public/</a></p><p>Releases are automatically sync'd from there to the Maven Central Repository at <a class="external-link" href="http://repo1.maven.org/maven2/" rel="nofollow">http://repo1.maven.org/maven2/</a></p><h3>How to configure release repositories</h3><p>Nothing to do here. Maven-based tools, including Leiningen, always check the Maven Central Repository for releases.</p><p>It takes up to 24 hours for a new release to be sync'd from the Sonatype repository to Maven Central. If you want to get a new release sooner, use the same instructions as for snapshot repositories, below.</p><h3>How to configure snapshot repositories in Leiningen</h3><h3><span style="color: rgb(51,51,51);font-size: 10.0pt;font-weight: normal;line-height: 13.0pt;">In a </span><strong style="color: rgb(51,51,51);font-size: 10.0pt;line-height: 13.0pt;">Leiningen/Cake</strong><span style="color: rgb(51,51,51);font-size: 10.0pt;font-weight: normal;line-height: 13.0pt;"> </span><code style="color: rgb(51,51,51);font-size: 10.0pt;font-weight: normal;line-height: 13.0pt;">project.clj</code><span style="color: rgb(51,51,51);font-size: 10.0pt;font-weight: normal;line-height: 13.0pt;"> file:</span></h3><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="lang=none" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZz1ub25lfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"} </pre></td></tr></table><h3>How to configure snapshot repositories in Gradle</h3><p>In a <strong>Gradle</strong> <code>build.gradle</code> file:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="lang=none" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZz1ub25lfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>repositories { mavenRepo urls: "https://oss.sonatype.org/content/groups/public/" } </pre></td></tr></table><h3>How to configure snapshot repositories in Maven</h3><p>In a <strong>Maven</strong> project's <code>pom.xml</code> file:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><repositories> <repository> <id>sonatype-oss-public</id> <url>https://oss.sonatype.org/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories></pre></td></tr></table><h3>How to configure snapshot repositories globally in Maven</h3><p>This only works if you are building your projects with Maven itself, not with Maven-based tools such as Leiningen.</p><p>In your <code>~/.m2/settings.xml</code> file:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=html/xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9aHRtbC94bWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><settings> <profiles> <profile> <id>sonatype</id> <repositories> <repository> <id>sonatype-oss-public</id> <url>https://oss.sonatype.org/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <!--make the profile active all the time --> <activeProfile>sonatype</activeProfile> </activeProfiles> </settings></pre></td></tr></table><h1>Historical Notes</h1><h3>Monolithic "clojure-contrib" after 1.2.0</h3><p>After the 1.2.0 release, clojure-contrib was split into multiple sub-modules. This proved even more cumbersome than the monolithic clojure-contrib, and is being phased out. <strong>There is no plan to release clojure-contrib post-1.2.0 in either monolithic or modularized forms.</strong></p><p>Instead, new development of "contrib" libraries is occurring in <a href="http://github.com/clojure">independent Git repositories</a>. Each library can have its own version and release cycle, independent of Clojure. Snapshots and releases of these "new contribs" are uploaded to the public repository at oss.sonatype.org and sync'd to Maven central just like Clojure itself.</p><h3>Clojure and clojure-contrib releases 1.2.0 and earlier</h3><p>For Clojure the language and clojure-contrib versions 1.0.0, 1.1.0, and 1.2.0, releases and snapshots were uploaded to a public repository at <a class="external-link" href="http://build.clojure.org/releases" rel="nofollow">http://build.clojure.org/releases</a> and <a class="external-link" href="http://build.clojure.org/snapshots" rel="nofollow">http://build.clojure.org/snapshots</a> respectively.</p><p>Clojure releases 1.0.0, 1.1.0, 1.2.0, and 1.2.1 were also manually uploaded to the Maven Central Repository.</p><p>Clojure-contrib release 1.2.0 was manually uploaded to the Maven Central Repository.</p>
Attachments
Labels
Location
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced