Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you exclude conf folder in sbt dist task

I am trying to create a package using sbt-native-packager without the conf folder being in the project jar. I have my conf folder included as such:

resourceDirectory in Compile <<= baseDirectory(_ => new File("conf"))

This include the conf files in the project jar is there a way I can have the conf files included on the classpath for runtime,test,console but not dist?

like image 878
Dimitry Avatar asked Oct 20 '22 11:10

Dimitry


2 Answers

Try something like

mappings in (Compile, packageBin) ~= { _.filterNot { case (_, name) =>
  Seq("application.conf", "anotherconfig").contains(name)
}}
like image 144
Alexey Yamshanov Avatar answered Oct 23 '22 23:10

Alexey Yamshanov


A variation of your @Alexey Yamshanov very useful above answer.

It excludes some configuration files from packaging inclusion. For instance ending with dev.conf, prod.conf

mappings in (Compile, packageBin) ~= {
  _.filterNot { case (_, name) => Seq("dev.conf", "prod.conf").exists(name.endsWith) }
}
like image 23
Patrick Refondini Avatar answered Oct 23 '22 23:10

Patrick Refondini