librelist archives

« back to archive

Leiningen, dependency resolution and system properties

Leiningen, dependency resolution and system properties

From:
Chell, Stephen
Date:
2014-12-04 @ 05:43
Hi all

I'm fairly new to Clojure/Leiningen and have an issue with dependency 
resolution as follows.

I'm trying to use lein to run a simple Clojure program that has 
dependencies on some java libraries in my local maven repository.   Most 
of these dependencies resolve fine, but in the pom file of one of the 
libraries is a dependency on another project as follows:

      <dependency>
                <groupId>com.westpac.fxcalypso</groupId>
                <artifactId>fxc-wibresources</artifactId>
<classifier>${env}-conf</classifier>
      </dependency>

The fact that the <classifier> depends on a system property called "env" 
is causing problems.  When I run my clojure program using "lein run", it 
fails with the following:

(Could not find artifact 
com.westpac.fxcalypso:fxc-wibresources:jar:DEV1-conf:odr-Build1-SNAPSHOT 
in Nexus ( [url removed] ))

The problem is its using the default value for env which is "DEV1", but in
my case I need env to be "DEV6".    When building using maven this is 
easily achieved using a command line argument of -Denv=DEV6.      Is there
a way to specify a java system property via the lein command line?

Note:
The problem library is configured as a dependency in my project.clj file 
as follows:

[com.westpac.fxcalypso/fxc-wibfxcalypso "odr-Build1-SNAPSHOT"]

Adding a classifier of "DEV6-conf" as follows ...

[com.westpac.fxcalypso/fxc-wibfxcalypso "odr-Build1-SNAPSHOT" :classifier 
"DEV6-conf"]

... doesn't help, as that classfier is only applied to the 
fxc-wibfxcalypso library (which causes further problems), not its 
dependencies.

Thanks in advance for any help ...

Stephen


Confidential communication
Westpac Banking Corporation (ABN 33 007 457 141)
Westpac Institutional Bank is a division of Westpac Banking Corporation