0
votes

I have cloned sbteclipse.I am reading scala-sbt tutorial,says:

If your project is in directory hello, and you’re adding sbt-site plugin to the build definition, create hello/project/site.sbt

I am in /home/mil directory,and sbteclipse is in the same directory.Inside sbteclipse is project directory with plugins.sbt

libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value

addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3")

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")

Should I edit this file or not?How to declare plugin in oreder to enable eclipse to recognize them?

1

1 Answers

1
votes

As a general rule, SBT plugins has to be defined in the project subfolder of your project's root. SBT aggregates definitions from all files with .sbt extension, so it doesn't really matter if you call it plugins.sbt or site.sbt. It's also fine to have multiple .sbt files.

So in your particular case, either add that plugin to the existing project/plugins.sbt, or follow the tutorial and create a new file, project/site.sbt, and add the plugin there.

P.S. this rule of searching and aggregating definitions from all .sbt files applies not only to meta-build (project directory), but also for the build itself. It might make sense to split big build definitions into multiple .sbt files. E.g. we have build.sbt for main definitions (library dependencies, etc.) and docker.sbt for Docker definitions.