Fork me on GitHub
#leiningen
<
2016-03-04
>
hypirion10:03:46

@dmuylwyk: The normal lein deploy task won't work there. What you'd do if you want to deploy an uberjar is to use the extended version of lein deploy repo: I think you can do lein do uberjar, pom, deploy repo :project/version :project/uberjar-name pom.xml to deploy the uberjar, but you should probably try it out

hypirion10:03:05

You can look at lein help deploy for information

dmuylwyk14:03:09

Thanks, @hypirion. I'll give that a try today. If I run into trouble, may I contact you directly with questions?

cjmurphy15:03:32

There's an issue that when putting Akka code into an uberjar (with lein uberjar) it can't find 'akka.version'. Is the solution to this to have :pom-plugins [[org.apache.maven.plugins/maven-shade-plugin 2.2]] in the project file? Well I tried but it didn't help. There's a .conf file at the root level of the uberjar, so it looks like all the merging has been done fine. There's actually no 'akka.version' there. I'm trying to make a Clojure web server by wrapping a Scala/Java/Akka one.

dmuylwyk16:03:14

Thanks, @hypirion. Deploying arbitrary artifacts is exactly what I wanted to do.

dmuylwyk17:03:38

After creating an uberjar, I can deploy to work as follows: lein deploy releases com.company.team/myproject 1.0.18 ./target/myproject.jar I'm having trouble getting it to work with: lein deploy releases com.company.team/myproject :project/version :project/uberjar-name or lein deploy releases com.company.team/myproject :version :uberjar-name Anyone know how to reference my version number and uberjar-name in command line?

hypirion17:03:44

@dmuylwyk: Yeah, it's probably not going to work on the path, but that may be something we could fix I would consider setting this up as a part of the release task and see if that would work, e.g. replacing ["with-profile" "uberjar" "deploy"] with the three tasks ["uberjar"] ["pom"] ["deploy" "repo" :project/version :project/uberjar-name "pom.xml"]. I believe that should work, I'd say it's a bug otherwise.

dmuylwyk17:03:35

@hypirion: That's what I'm testing right now. I've just run this and it seems to do what I need:

;;run all three with release.sh
  :aliases {"release-prepare!" ["do"
                                ["vcs" "assert-committed"]
                                ["change" "version" "leiningen.release/bump-version" "release"]
                                ["vcs" "commit"]
                                ["vcs" "tag" "--no-sign"]
                                ["uberjar"]]
            "release-deploy!"  ["deploy" "releases" "com.mycompany.team/myproject" "1.1.1" "./target/myproject.jar"]
            "release-push!"    ["do"
                                ["change" "version" "leiningen.release/bump-version"]
                                ["vcs" "commit"]
                                ["vcs" "push"]]}

dmuylwyk17:03:23

So now I just need to substitute "1.1.1" with :project/version or :version or simply "version".

dmuylwyk17:03:30

@hypirion: FYI, I split my release tasks into aliases, which are in turn called by release.sh (lein release-prepare! && release-deploy! && ...) because the interactive prompt for :creds :gpg doesn't work when ran after other (potentially) interactive tasks.

dmuylwyk17:03:29

I'm having trouble resolving version properly. With what should I replace the question mark?

["deploy" "releases" "com.mycompany.team/myproject" ? "./target/myproject.jar"]
This is the final piece of the puzzle for me.

hypirion18:03:54

It should be :project/version

hypirion18:03:22

if not then that's a bug

dmuylwyk18:03:35

@hypirion: That did it. I must have had a typo the first time I tried.

dmuylwyk18:03:46

@hypirion: Thank you so much for your help!

hypirion19:03:53

Nice, good to know it worked!

dmuylwyk19:03:04

It meets my needs. The shell script calling aliases in sequence is a little annoying but I haven't been able to get Leiningen to prompt for credentials without it. Thanks again for you help.

dmuylwyk19:03:11

@hypirion: You even get a shout out on my reddit post. : )