Reputation: 8854
I have a project.clj file derived from someone else's git repo. There's a line that reads
:jvm-opts ^:replace []
I know that :jvm-opts
allows adding java command line options. What does ^:replace
do? There is some about it in Leiningen's profile.md, and it's mentioned in Leiningen's example project file sample.project.clj, but I still don't understand. I want to add "-Xmx1G"
to to jvm-opts.
Upvotes: 4
Views: 900
Reputation: 4702
Just add to the options vector the one you need:
:jvm-opts ["-Xmx1g"]
If you have more than one:
:jvm-opts ["-Xmx1g" "-server"]
replace
can be used in many configuration options where different map
sets
or vectors
are merged.
So in this situation if you want the jvm-opts
to be only the ones you specify use replace
metadata (otherwise other options may be merged depending on your configuration)
Upvotes: 4