Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:05:02+00:00 2026-06-12T08:05:02+00:00

I have multiple SBT projects that all have a common setup – e.g. multi

  • 0

I have multiple SBT projects that all have a common setup – e.g. multi module, publishTo settings etc etc.

How do I provide a common e.g. CommonBuild class that each of the projects can extend from it? For example:

trait CommonBuild {
  val publishSettings = Seq(
    publishTo := Some("", ""),
    credentials += ...
  )

  def module(name: String) (
    settings: Seq[Setting[_]],
    projectId: String = PROJECT + "-" + name,
    dirName: String = name,
    srcPath: String = PROJECT + name
    ) = Project(projectId, file(dirName), settings = (buildSettings ++ srcPathSetting(projectId, srcPath)) ++ publishSettings ++ settings)

}

Now it can be used by a project build:

object ProjABuild extends CommonBuild {
   // use CommonBuild methods / vals
}

object ProjBBuild extends CommonBuild {
   // use CommonBuild methods / vals
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:05:03+00:00Added an answer on June 12, 2026 at 8:05 am

    I wanted to do this too. Importantly, the common setup needs to live in its own project on which the subprojects depend, so that a change made to the common setup automatically takes effect in all of the subprojects. The only way to accomplish this is to put the common stuff in an SBT plugin.

    I wrote such a plugin, called iesl-sbt-base. It provides a pile of boilerplate, so that the Build.scala file for your project can be trivially short. It provides:

    • Resolver configuration
    • Simplified dependency resolution with automatic updating
    • Clarity on what transitive dependencies are used
    • Optional protection from snapshot versions
    • Cleaned-up logging configuration

    Please see https://github.com/iesl/iesl-sbt-base for details. You’ll probably want to fork that to change things that are specific to my setup (e.g., especially resolver URLs). If there’s demand, I can think about how to make it more configurable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SBT project that contains multiple subprojects, i.e.: > projects [info] In
We'd like to set up our SBT project so that we have multiple test
I have multiple classes that all contain the same property along with a whole
I have multiple classes that all derive from a base class, now some of
I have multiple threads (C# application running on IIS) running that all need to
I have an SBT project with multiple subprojects. One of the subprojects have tests
I have multiple projects which are to be hosted together in a Tomcat container,
I have multiple domains on my server. I want to redirect all of them
I have multiple table rows that has a set of radio buttons on each
I have multiple elements with the same class clickable, i'm binding all these classes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.