How to access values on leiningen profiles?

Viewed 5039

I've got a two profiles defined in project.clj, one locally, one for testing on travis:

:profiles {:dev {:dependencies [[midje "1.6.0"]
                                [mysql/mysql-connector-java "5.1.25"]]
                 :plugins [[lein-midje "3.1.3"]]
                 :user "root" :pass "root"}
           :travis {:user "travis" :pass ""}}

I'm hoping to be able to get access to the :user and :pass values in my projects. How can this be done?

Update:

I also want to be able to use the lein with-profile command... so my tests would have:

lein with-profile dev test

-> would use "root", "root" credentials

lein with-profile dev,travis test

-> would use "travis", "" credentials

2 Answers
Related