You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assume that sbt script is located in /opt/sbt/bin, so sbt home is /opt/sbt/
cd any_project_dir
# put default optionsecho"-Dsbt.repository.config=/opt/sbt/conf/repositories">/opt/sbt/conf/sbtopts
# put project optionsecho"-Dsbt.repository.config=repositories">.sbtopts
# run any sbt command in debug mode
sbt -d sbtVersion
so our project options have been put at the beginning of cmd line and hence overridden by the dist default options from /opt/sbt/conf/sbtopts
this happens because options from the sbtopts files are pushed to the beginning of the command line
here is the excerpt form the sbt script:
# Here we pull in the default settings configuration.
[[ -f"$dist_sbt_opts_file" ]] &&set -- $(loadConfigFile "$dist_sbt_opts_file")"$@"# Here we pull in the global settings configuration.
[[ -f"$etc_file" ]] &&set -- $(loadConfigFile "$etc_file")"$@"# Pull in the project-level config file, if it exists.
[[ -f"$sbt_opts_file" ]] &&set -- $(loadConfigFile "$sbt_opts_file")"$@"
expectation
priority of the files must be exactly inverse (from higher to lower) :
project .sbtopts
system global settings /etc/sbt/sbtopts
dist defafult settings ${sbt_home}/conf/sbtopts
notes
fix is trivial: we just need to reorder the above code like that:
# Pull in the project-level config file, if it exists.
[[ -f"$sbt_opts_file" ]] &&set -- $(loadConfigFile "$sbt_opts_file")"$@"# Here we pull in the global settings configuration.
[[ -f"$etc_file" ]] &&set -- $(loadConfigFile "$etc_file")"$@"# Here we pull in the default settings configuration.
[[ -f"$dist_sbt_opts_file" ]] &&set -- $(loadConfigFile "$dist_sbt_opts_file")"$@"
The text was updated successfully, but these errors were encountered:
steps
assume that sbt script is located in /opt/sbt/bin, so sbt home is /opt/sbt/
problem
this is the actual output
so our project options have been put at the beginning of cmd line and hence overridden by the dist default options from
/opt/sbt/conf/sbtopts
this happens because options from the sbtopts files are pushed to the beginning of the command line
here is the excerpt form the sbt script:
expectation
priority of the files must be exactly inverse (from higher to lower) :
.sbtopts
/etc/sbt/sbtopts
${sbt_home}/conf/sbtopts
notes
fix is trivial: we just need to reorder the above code like that:
The text was updated successfully, but these errors were encountered: