Fork me on GitHub
#off-topic
<
2017-01-11
>
lmergen10:01:49

as i'm a bit of a java noob, can anyone point me in the right direction on how to always override certain system properties ?

lmergen10:01:59

is it possible using a properties file in the resources/ directory or something ?

lmergen10:01:22

or will i need to call System.setProperty () while launching my application all the time ?

Rachel Westmacott10:01:04

if you call System.setProperty you will have to be sure that no-one has called System.getProperty with the same property name before you

lmergen10:01:52

so, that's going to be buggy then

Rachel Westmacott10:01:20

well it probably depends what the property is and who reads it

Rachel Westmacott10:01:34

but you’d need to be careful

Rachel Westmacott10:01:41

if its a small set of properties you could pass them to the JVM on startup I think

Rachel Westmacott10:01:47

or use a tool to do that for you

Rachel Westmacott10:01:59

depends a bit on how you start the JVM

sveri11:01:21

@lmergen This is more of a code question. When reading / using the system property in your application you have to make sure at that point that some other property is overridden.

lmergen11:01:18

yeah, what i want is pretty much ensure that spec's assertions are always enabled (which is based on a runtime system property), without having to manually call a function in my code

lmergen11:01:36

i would much rather have a file in the resource/ directory that specifies this, and would've expected the jvm to support this

sveri12:01:57

@lmergen System Properties can be passed into the application in different ways, depending on the code or a possible configuration library. Even if you have a properties file in the resources folder that: 1. has to be loaded in your application and 2. can be overridden on application startup by providing the property directly like: java -Dproperty=foo.bar -jar baz.jar

lmergen12:01:35

yeah i'm aware of that

lmergen12:01:46

that's a good thing, i guess

lmergen12:01:14

but i am more thinking about the best place to specify what i want the default behavior to be

sveri13:01:18

Your code

sveri13:01:28

which can be overridden by configuration / external properties

sveri13:01:56

At least thats my thinking here, but, I am not in your place, so you might decide different

kammitama19:01:18

Hi everyone and good day! I don't work in Clojure but am learning Clojure, and attended Conj 2016. I am doing a three-month mentorship (unfortunately, the language we agreed on was Python, but maybe I can rebuild in Clojure 🙂 ) and we are in the initial stages of researching and obtaining information to build the best application that we can over the three-month period. It would be of great help to our team if you could spend five minutes filling out our nine-question survey. If anyone wants to contact me to follow up with the information gathered, you are more than welcome, too! I really, greatly appreciate this, and I am sorry for "spamming" (I promise we're building something fun!) Thank you and have a great day! -> https://goo.gl/forms/LUBrX8CV1Jia8dsc2

scaturr20:01:49

Made a simple ClojureScript library for watermarking images if anyone is interested in looking. Was a good crash course for me in figwheel, devcards, and Clojure(Script) in general. Definitely digging the language, tools, and people so far 🙂 https://github.com/brianium/dandy-roll