Can lein install create checksum (MD5, SHA-1) files when installing artifacts in a local Maven repository? Heroku requires artifacts be deployed with checksum files.
lein install generates a pom.xml, but when running mvn install -DcreateChecksum=true from that pom.xml, mysteriously the .clj files are not packaged up in the artifact jar.
> Can lein install create checksum (MD5, SHA-1) files when installing
> artifacts in a local Maven repository? Heroku requires artifacts be
> deployed with checksum files.
Can you explain a bit more about what you're trying to do? I can't think
of anything specific to Heroku that would require checksum files.
> lein install generates a pom.xml, but when running mvn install
> -DcreateChecksum=true from that pom.xml, mysteriously the .clj files
> are not packaged up in the artifact jar.
It sounds like you might want "lein deploy" rather than "lein install";
that should create the necessary metadata files.
-Phil
Julien Chastang writes:> Can lein install create checksum (MD5, SHA-1) files when installing
> artifacts in a local Maven repository? Heroku requires artifacts be
> deployed with checksum files.Can you explain a bit more about what you're trying to do? I can't think
of anything specific to Heroku that would require checksum files.
I have Clojure project artifacts that are not in a public Maven repository, but simply in a local repository (so-called unmanaged dependencies). When pushing a project to Heroku, Heroku will attempt to install the local dependencies from a Maven repository that is bundled with your project. See https://devcenter.heroku.com/articles/local-maven-dependencies. If the artifacts do not contain checksum files, they are ignored by the installation process, or at the very least you get pesky warnings about this. (The whole unmanaged dependency Heroku deployment is fragile, and took me a while to get right.)
> lein install generates a pom.xml, but when running mvn install
> -DcreateChecksum=true from that pom.xml, mysteriously the .clj files
> are not packaged up in the artifact jar.It sounds like you might want "lein deploy" rather than "lein install";
that should create the necessary metadata files.
Build jar and deploy to remote repository.
$ lein help install
Install current project or download specified project. With no arguments, installs the current project and its dependencies in your local repository.
Thanks for all your work with leiningen. It is a nice tool.
OK, I see. I've been working on a better approach to private
dependencies, but it's not very well documented yet.
The gist of it is to get the dependencies into a repository hosted on
a private S3 bucket. Getting them out there is pretty easy once you
have an AWS account; just follow the steps on
https://github.com/technomancy/s3-wagon-private and do "lein deploy"
once you've added the bucket to :repositories with an s3p:// URL.
Then on Heroku you'll need to switch on the build-time config flag:
https://devcenter.heroku.com/articles/labs-user-env-compile followed
by adding your AWS credentials as config vars:
$ heroku config:add AWS_ACCESS_KEY=[...] AWS_SECRET_KEY=[...]
Then you need to pull in the latest revision of the Clojure buildpack
as it's still a relatively new feature:
$ heroku config:add
BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-clojure.git
Then check in a file under .lein/init.clj that sets leiningen-auth
using System/getenv:
(def leiningen-auth {"s3p://secret-bucket/releases"
{:username (System/getenv "AWS_ACCESS_KEY")
:passphrase (System/getenv "AWS_SECRET_KEY")}})
I hope to have this better documented soon. Let me know if you have
any issues with it.
-Phil