If we want to print/log a simple variable like,
lazy val config = ConfigFactory.load()
And inspect its value in sbt, then how do we do that?
When I just type it in sbt shell, I get:
> config
[error] Not a valid command: config
[error] Not a valid project ID: config
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: config (similar: configuration, deploy-configs, conflictManager)
[error] config
Typically, if a key has no associated value in a more-specific scope, sbt will try to get a value from a more general scope, such as the ThisBuild scope. This feature allows you to set a value once in a more general scope, allowing multiple more-specific scopes to inherit the value.
Create or open your sbt project. In the Project tool window, in the source root directory, locate the build. properties file and open it in the editor. In the editor explicitly specify the version of sbt that you want to use in the project.
If you want to print something when you type a string in sbt console,you can add
lazy val configTest = settingKey[String]("example")
configTest := "config test"
Then you will get
> configTest
[info] config test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With