[ANN] Clojars - a Clojure community jar repository

87 views
Skip to first unread message

Alex Osborne

unread,
Nov 19, 2009, 8:17:17 AM11/19/09
to clo...@googlegroups.com
I've been working on an easy to use open source community repository to
complement Leiningen in making building and dependency management easier
for Clojure projects.

http://clojars.org/

It's inspired by the fantastic Gemcutter.org website that the Ruby
community uses. The repository is in the standard Maven repository
layout so in addition to Leiningen it will be usable with other tools
like Maven and Ivy as well.

The repository URL is

http://clojars.org/repo

but if you're using Leiningen you don't have to do anything special to
use it as it's already on the list of default repositories.

To push to the repository you don't need any special tools, just create
a pom.xml giving your project a group, name, version and a list of
dependencies and scp it to clo...@clojars.org. With Leiningen this
looks like:

lein pom
scp pom.xml myproject.jar clo...@clojars.org:

But if even that's too long and complicated for you I wrote a Leiningen
plugin which makes it just:

lein push

There's a tutorial which goes through creating, building a simple
library with Leiningen and then pushing it to Clojars repository here:

http://wiki.github.com/ato/clojars-web/tutorial

But what about Maven Central?

It's a huge hassle to get things into Maven Central. You generally have
to get manual approval from someone which can take a while and the
requirements are quite complex. I wanted a much simpler and quicker way
of distributing jars that you can use for forks and personal projects as
well.

Can I upload Java libraries?

If a Java library is not already in the Maven Central repository and
you'd like to use it in a Clojure project, sure. I'm targetting Clojure
but there's nothing stopping you from uploading jars for Java or JRuby
or Scala or anything else. If you upload a library which you're not the
author/maintainer of, please give it a personal groupId like
'org.clojars.your-username' so that you don't squat on the project's
official groupId.

Please let me know if you encounter any problems and I'll do my best to
resolve them.

Baishampayan Ghose

unread,
Nov 19, 2009, 10:02:11 AM11/19/09
to clo...@googlegroups.com
Alex,

> I've been working on an easy to use open source community repository to
> complement Leiningen in making building and dependency management easier
> for Clojure projects.

Beautiful work, Alex. Really amazing.

Kudos to you and the awesome Clojure community.

Regards,
BG

--
Baishampayan Ghose <b.g...@ocricket.com>
oCricket.com

signature.asc

Alex Osborne

unread,
Nov 19, 2009, 2:56:43 PM11/19/09
to clo...@googlegroups.com
Alex Osborne wrote:

> But if even that's too long and complicated for you I wrote a Leiningen
> plugin which makes it just:
>
> lein push

Looks like JSch library that the lein-clojars plugin uses doesn't work
with ssh-keygen's DSA keys and I overlooked adding passphrase support.
I'm working on fixing this but for now if you're having problems I
recommend pushing with:

lein pom
scp pom.xml yourlib.jar clo...@clojars.org:

Laurent PETIT

unread,
Nov 19, 2009, 3:14:38 PM11/19/09
to clo...@googlegroups.com
Hello,

Just an idea out of my head : could it be possible for the pom.xml to be included in the jar, in the META-INF/ directory ?

This would even further simplify the process, wouldn't it ? :)

2009/11/19 Alex Osborne <a...@meshy.org>

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Alex Osborne

unread,
Nov 19, 2009, 3:28:41 PM11/19/09
to clo...@googlegroups.com
Laurent PETIT wrote:
> Hello,
>
> Just an idea out of my head : could it be possible for the pom.xml to be
> included in the jar, in the META-INF/ directory ?
>
> This would even further simplify the process, wouldn't it ? :)

That's a great idea! Can't believe it didn't occur to me. :-)

I looks like Maven does this, it puts two files in the jar:

META-INF/maven/$groupId/$artifactId/pom.xml
META-INF/maven/$groupId/$artifactId/pom.properties

pom.properties contains:

version=1.0.0
groupId=mygroup
artifactId=myjar

So it looks like you can use that to figure out what version a library
is just using the java properties system. We should make Leiningen do
the same.

Alex

Laurent PETIT

unread,
Nov 20, 2009, 12:31:59 PM11/20/09
to clo...@googlegroups.com

Phil Hagelberg

unread,
Nov 20, 2009, 1:41:22 PM11/20/09
to clo...@googlegroups.com
Alex Osborne <a...@meshy.org> writes:

> I looks like Maven does this, it puts two files in the jar:
>
> META-INF/maven/$groupId/$artifactId/pom.xml
> META-INF/maven/$groupId/$artifactId/pom.properties
>
> So it looks like you can use that to figure out what version a library
> is just using the java properties system. We should make Leiningen do
> the same.

This is a solid idea; I will target it for leiningen 1.0.

-Phil
Reply all
Reply to author
Forward
0 new messages