I have a simple web project based on clojure, that just contains some markdown files in the resources folder. Previously I ran it with
cd my-project
lein ring server
and then I viewed the running project in the browser at http://localhost:port.
Now I wanted to integrate this process with jenkins so I
But then, Jenkins always complains about
> java -client -XX:+TieredCompilation
> -Xbootclasspath/a:/home/.lein/self-installs/clojure-1.8.0.jar
> -Dfile.encoding=UTF-8
> -Dmaven.wagon.http.ssl.easy=false
> -Dleiningen.original.pwd=/var/lib/jenkins/jobs/my-project/workspace
> -cp /home/.lein/self-installs/clojure-1.8.0.jar clojure.main -m leiningen.core.main install
>
> Error: Could not find or load main class clojure.main
> Build step 'Build project using leiningen' marked build as failure
I assumed, jenkins is missing the clojure.jar and it's not installing it to the .m2 repository, so I added it manually to
/var/lib/jenkins/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
But that doesn't change anything for the build.
How to tell jenkins where to find the clojure.main? Any hints, what I am missing?
tl;dr - check permissions
When you setup leiningen+plugin for Jenkins make sure that the service account that jenkins is running under is the owner and has permissions to the leiningen-standalone.jar
In my case I installed leiningen at /var/lib/jenkins/.lein
which was the default for the jenkins install and changed owner to jenkins:jenkins
Have you added clojure as a dependency in your project.clj?
:dependencies [[org.clojure/clojure "1.8.0"]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With