Q:

Maven2: use ${basedir} in jar path

I am using an external, proprietary jar in my project.   When I hard-code the path as follows in my pom.xml, it works fine:
<dependency>
  <groupId>com.foo.bar</groupId>
  <artifactId>bar</artifactId>
  <version>5.2</version>
  <scope>system</scope>
  <type>jar</type>
  <systemPath>D:\workspace\myproj\external\companyname\lib\proprietary_api.jar</systemPath>
</dependency>

However, when I try to use the ${basedir} variable, maven can't find the jar:
<dependency>
  <groupId>com.foo.bar</groupId>
  <artifactId>bar</artifactId>
  <version>5.2</version>
  <scope>system</scope>
  <type>jar</type>
  <systemPath>${basedir}\external\companyname\lib\proprietary_api.jar</systemPath>
</dependency>

The pom is located in D:\workspace\myproj
This also needs to be cross-platform compatible (dev on Windows, deploy on Linux). 
Thanks! 

A:

It is wrong to use system scope for your proprietary JARs.  You should deploy or install it into the local/central repository. 

A:

I'm not sure this will help, but try using forward (/) instead of backward (\) slashes.  Also, try running it with mvn -e and mvn -X (the latter will produce a lot of debugging lines) - this might help you pinpoint the problem. 
Here's an example:

http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/maven-2-pomxml

of using ${basedir} in the same way you want. 
Btw, why don't you mvn install:install-file the dependency instead of using systemPath?  See:

http://maven.apache.org/plugins/maven-install-plugin/usage.html

A:

In order to be cross-platform compatible use ${file.separator} instead of the slashes.. 
so that will automatically convert to OS specified format

