Question

Processing's (processing.org) basic library jars are not on clojars or maven. I have a project going with clojure and would like to upload the jars to clojars under my username. It was kind of tedious to get them into my .m2 folder one a time. I will be need to be able to access them via clojars so that others can help me with my project. How can I upload these dependencies?

lein deploy clojars doesn't upload the dependencies - all the processing library jars.

My processing localrepo is also on github stored here:

https://github.com/originalsurfmex/originalsurfmex_m2/tree/master/repository/processing

Was it helpful?

Solution 3

Thanks for your help and links so far. This is as far as I have gotten:

I have had some success - minus the ability to sign jars and poms.

I gotta admit though its kind of a pain. Here is the process. There must be an automated way to do this right?

Go to your .m2/repository/group/library/version/ folder

  1. md5sum lib.jar > lib.jar.md5
  2. sha1sum lib.jar > lib.jar.sha1
  3. Change the groupId in lib.pom from

<groupId>libgroup</groupId>

to

<groupId>org.clojars.username.libgroup</groupId>

  1. Add missing sections in lib.pom by hand otherwise clojars complains:

<description>processing-libs</description> <url>http://www.processing.org</url> <scm> <tag>something relevant?</tag> <url>somewhere relevant?</url> </scm> <licenses> <license> <name/> <url/> <distribution/> </license> </licenses> <developers> <developer> <id/> <name/> <email/> </developer> </developers> <repositories> <repository> <id>clojars.org</id> <url>http://clojars.org/repo/</url> </repository> </repositories>

  1. md5sum lib.pom > lib.pom.md5
  2. sha1sum lib.pom > lib.pom.sha1
  3. scp lib* clojars@clojars.org:

Here they are in github (the md5 and sha1 files not included of course):

https://github.com/originalsurfmex/originalsurfmex_m2/tree/master/repository/processing/core/2.1

https://github.com/originalsurfmex/originalsurfmex_m2/tree/master/repository/processing/gluegen-rt/2.1

Here they are in clojars:

https://clojars.org/org.clojars.originalsurfmex.processing/core

https://clojars.org/org.clojars.originalsurfmex.processing/gluegen-rt

Before I go ahead and add all of these libs I have two concerns:

  1. I have polluted clojars.org my mistakes --> https://clojars.org/users/originalsurfmex

  2. Is it gonna be a waste or a deal breaker that my jars and poms aren't signed? I can't seem to figure out how to sign them. I have SSH and PGP setup on clojar.org and scp runs just fine.

OTHER TIPS

If this info http://blog.rueedlinger.ch/2012/09/use-github-as-maven-remote-repository/ is useful for you to use a github repo as maven repository, then you only have to declare this github repo on your project.clj. You can see an example here https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L76

  :repositories [["your-id" "https://github.com/originalsurfmex/originalsurfmex_m2/tree/master/repository"]]

UPDATE: You are right, the comment above doesn't fully answer your question, so I'll try again :)

So, how to push a lib to clojars if the dependencies aren't in clojars yet? I never pushed a lib to clojars so the next are only ideas but, I've been searching the same problem in one real published case (quil/quil) and these are my conclusions:

In the quil project.clj the "problematic" dependencies are in "handmade" clojars. if you look into your ~/.m2 local repository you can find all of them prefixed by "org/clojars/" instead of "org.processing", The dev [@samaaron] that pushed these dependencies to clojars had to create one separated project by dependency, configured it:

<dependency>
  <groupId>org.clojars.processing-core</groupId>
  <artifactId>org.processing.opengl</artifactId>
  <version>1.5.1</version>
</dependency>

and pushed each one to clojars.

I think that if you take a look inside one of these quil dependencies on your local maven repo you'll figure aout the way you have to follow to that (basically: to have a java project, download the source, configure pom.xml and upload java code to clojars )

Good luck

If you're still using Processing 1.5.1, you can find all the required jars on Clojars, however in that case you could also just pull Quil into your project, which then pulls in all other repackaged Processing jars too (incl. native libs for OpenGL).

Here're some more general bullet points for repacking a jar & uploading it to Clojars: https://groups.google.com/forum/#!topic/clojure/KxwhVg7L_gA

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top