Closed levinotik closed 11 years ago
I should point out that I CAN read from the config file that I've placed in src/main/resources/ but I cannot read any values that I've placed in myapp/config/somefolder/some.conf. The latter case works just fine with a regular run
though.
Hi Levi. Yes, the sbt-atmos plugin creates a new classpath, based on a different ivy configuration that also includes the trace jars. It does this for dependency resolution of akka and play dependencies, between the application's versions and the versions supported by atmos.
As a workaround, if you're changing the classpath through sbt settings, you can apply the same changes to the atmos classpath. Use similar changes but scoped to classpaths in Atmos
. You can see the classpath that sbt-atmos creates with show atmos:full-classpath
.
If you can create a sample application that demonstrates what you want to do, I can work from that and think about how to improve this in future versions.
Thank you for the prompt reply @pvlugter. I'm trying to add my unmanagedClassPath stuff to an Atmos
scope, but when I try that SBT complains about references to undefined settings
. Do you know how I can resolve this?
Nevermind, I mistakenly placed it in the wrong part of my build definition. Adding that didn't seem to help. I will work on creating a project that hopefully recreates the issue I'm seeing.
Also, I don't setting/task for atmos:full-classpath
. I see classpath
, but not full-classpath
My bad, looks like that was because I was using 0.1.2!
@levinotik, if you've been adding a config directory with something like:
unmanagedClasspath in Runtime <+= baseDirectory map { bd => Attributed.blank(bd / "config") }
adding to the unmanaged classpath in runtime. This should now be supported in the latest version of sbt-atmos (0.3.0).
You can also add to the unmanagedClasspath in Atmos
if needed, but this now defaults to the unmanagedClasspath in Runtime
.
Let us know if you still have problems with the classpath.
Some background info on my app's dependencies:
val scalaVersion = "2.10.2" val akkaVersion = "2.2.1" val atmosAkkaVersion = "2.2.0" val atmosVersion = "1.2.0"
My app has a config directory with several subfolders containing alternate application.conf files. When I run my app, I pass the desired config directory as an argument to the run script (as a way of loading different configs). Anyhow, when I run the app using
atmos:run
instead of a plainrun
things seem to go berzerk. The simplest symptom is that when I try grabbing a simple String from my config, I get acom.typesafe.config.ConfigException$Missing: No configuration setting found for key..
So I CAN access my config when I userun
but NOT when I useatmos:run
.I don't know if my title for this issue is accurate, but it seems like the issue could be the fact then when a JVM is forked for my app in order to allow the typesafe console to monitor it, the classpath is not being recreated correctly.