This is not a typical or standard solution to the above problem. However, he solved my specific problem when using the sbt-eclipse plugin to create project files.
It turns out that you can pass the relative path to the sbt-eclipse plugin and which will be distributed to the .classpath file.
./sbt eclipse -ivy ./ivy
That way, when you import a project into Eclipse, it will use all relative paths based on the root path of the project. It seems to work so far.
<classpathentry kind="lib" path="./ivy/cache/org.apache.avro/avro-compiler/bundles/avro-compiler-1.7.6.jar"/>
<classpathentry kind="lib" path="./ivy/cache/org.apache.avro/avro/bundles/avro-1.7.6.jar"/>
<classpathentry kind="lib" path="./ivy/cache/org.codehaus.jackson/jackson-core-asl/jars/jackson-core-asl-1.9.13.jar"/>
<classpathentry kind="lib" path="./ivy/cache/org.codehaus.jackson/jackson-mapper-asl/jars/jackson-mapper-asl-1.9.13.jar"/>
<classpathentry kind="lib" path="./ivy/cache/org.apache.commons/commons-compress/jars/commons-compress-1.4.1.jar"/>
Note that although this fixes import errors, the application is still running on the host machine instead of the virtual machine.
source
share