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 7669465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:36:08+00:00 2026-05-31T15:36:08+00:00

I am having problems building and running an SBT project. The protocol project is

  • 0

I am having problems building and running an SBT project.

  • The “protocol” project is used by several modules, including the “daemon”.

  • The “daemon” project should be packaged as an executable jar.

What is the “right” way of doing this?

Here’s my Build.scala:

object MyBuild extends Build {
lazy val buildSettings = Seq(
    organization := "com.example",
    version      := "1.0-SNAPSHOT",
    scalaVersion := "2.9.1"
    )

lazy val root = Project(
    id = "MyProject",
    base = file("."),
    aggregate = Seq(protocol, daemon)
    )

lazy val protocol = Project(
    id = "Protocol",
    base = file("Protocol")
    )

lazy val daemon = Project(
    id = "Daemon",
    base = file("Daemon"),
    dependencies = Seq(protocol)
    )
// (plus more projects)
  • 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-05-31T15:36:09+00:00Added an answer on May 31, 2026 at 3:36 pm

    The right way to do this is to use one of the sbt plugins for producing jars. I’ve tested both one-jar and assembly and both have support for excluding libraries from your jar. You can add the settings to individual projects so that only some of them will produce jars.

    I’m personally using assembly, but as this post points out, you will run into problems if you have overlapping filenames.

    Edit:

    For your example above you’d add the following imports at the top:

    import sbtassembly.Plugin._ 
    import AssemblyKeys._
    

    You’d modify the project to look like this:

    lazy val daemon = Project(
      id = "Daemon",
      base = file("Daemon"),
      dependencies = Seq(protocol),
      settings = assemblySettings
    )
    

    Also you need to add the following to your project/plugins.sbt (for sbt .11):

    addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.7.3")
    
    resolvers += Resolver.url("sbt-plugin-releases",
      new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
    

    If you decide to go with Assembly you’ll probably need to remove duplicate files. Here’s an example of the assembly code for excluding duplicate log4j.properties files in a project named “projectName”. This should be added as part of the “settings” sequence for the project. Note that the 2nd collect statement is the base implementation and is required.

    excludedFiles in assembly := { (bases: Seq[File]) =>
      bases.filterNot(_.getAbsolutePath.contains("projectName")) flatMap { base => 
        //Exclude all log4j.properties from other peoples jars
        ((base * "*").get collect {
          case f if f.getName.toLowerCase == "log4j.properties" => f
        }) ++ 
        //Exclude the license and manifest from the exploded jars
        ((base / "META-INF" * "*").get collect {
          case f if f.getName.toLowerCase == "license" => f
          case f if f.getName.toLowerCase == "manifest.mf" => f
        })
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some strange issues building and running a project on another computer. It's
Im having problems building a query with the linq to sql data query expression
I have an old C++ project and I'm having problem building it. For a
Im having problems with classpaths. I have used them before with import but I'm
im having problems starting a codeigniter project, the problem is that when i do
I am having some problems building a properly formatted SOAP message using XMLDocument in
I was having some other problems with some ports building for the wrong CPU
I am building an application on Mac in Qt. I am having problems in
I am having problems getting any kernel modules to build on my machine. Whenever
Having a very basic problem here building/running a Java skeleton to make use of

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.