Hi,
I have been looking for a solution to my problem and found some relevant questions (with answers) and was hoping to clarify and see if there was another solution.
We have a test that we run from sbt (sbt test) fires up 2 other java process. These processes need to have the same classpath as the project. When using sbt 0.7.7 we were able to just build a classpath based on lib and lib_managed. Added every jar in lib and lib_managed to the classpath at launch. Now that we are migrating to sbt 0.12.1 lib_managed has been replaced with the ivy cache. Adding every jar in the ivy cache might work, but I am sure that will lead to pain down the road (duplicate version, more jars than we actually need, conflicts, …)
What I need is a way to get the project classpath from within a running test so that I can pass it along to my spawned java processes. I have read through the following questions and answers, but was hoping my solution was not to generate a start script for my spawned processes.
https://groups.google.com/d/topic/simple-build-tool/RkaEEq_qcdM/discussion
https://groups.google.com/d/topic/simple-build-tool/GLm0PS65cfg/discussion
https://groups.google.com/d/topic/simple-build-tool/28LYFHGBbJI/discussion
Which lead to stack over flow
http://stackoverflow.com/questions/7449312/create-script-with-classpath-from-sbt
Another aspect of this, is when we run the tests from within IntelliJ we have to construct the classpath differently in the sbt 0.7.7 project, but use the same for sbt 0.12.1 (the IntelliJ project generation plugin works a little differently between 0.7.7 and 0.12.1). I am not that concerned about the intellij aspect as I can grab the java.class.path within the test and use it directly.
So, is there a way to get the project classpath within a
running test?
Thank you
Michael