My favorites | Sign in
Project Home Downloads
Updated Jul 31, 2013 by

sbt has moved

sbt is now hosted on GitHub:

This page previously documented sbt 0.7.7, which is no longer maintained.

The original content is archived at

Comment by timgilbert, Apr 17, 2009

Hi! I have a few questions that I hope the docs can be clarified to answer:

I'm confused about what the name of the main project configuration files needs to be called. Obviously every project won't use "TestProject?.scala", but does sbt just do a scan of project/build/src/ until it finds an instance of DefaultProject?, or does it decide based on the "project name," or what?

Would it be possible to provide a snapshot of what exactly the sbt command does when it creates a new project?

Also, assuming that I've already got a bunch of scala code, what would be a good way to get it laid out in a directory structure sbt will grok?


Comment by project member, Apr 17, 2009


sbt compiles the sources. In the process, it finds a public, concrete subclass of Project (multiple instances will produce an error) and creates an instance.

When a project is created, sbt puts the requested information in project/ file in Java properties format (see the Properties page for more information). It also creates the following directories: src/main/scala, src/main/resources, src/test/scala, src/test/resources, and lib.

The easiest way is to put your main sources in src/main/scala. You could alternatively change the source path in your project definition as indicated Changing Paths section.

I'll update the documentation to indicate this.

Thanks, Mark

Comment by project member, Apr 17, 2009

The information on project creation was actually already on the Setup page in the Create Project section. I added a couple of sentences to the end of the Examples section to clarify the situation with project definition sources.

Thanks, Mark

Comment by, Nov 12, 2010

can you add an example of defining custom packageOptions. I looked at the docs and tried to define it properly but still unsuccessful

Actually what I am trying to do is to change the name of the war package. I want to get rid of scala version from the name.

Comment by, Nov 25, 2010

Mark, a minor mistake at 'Package Options' it's java.util.jar.Attributes instead of java.util.Attributes

Comment by project member, Nov 29, 2010

Thanks, updated.

Comment by, Jan 23, 2011

The mavenLocal example is not working on Windows because the URL will be incorrect. Here is the fix:

val mavenLocal = "Local Maven Repository" at
    new File(Path.userHome + "/.m2/repository").toURI.toString
Comment by, Apr 7, 2011


I'd like to create a standalone jar file of my compiled scala project. (i.e. I want to be able to run the file on a system that has only java installed, but not scala).

I'm new to both Java and Scala, but I think I need to somehow get the scala-library.jar into the jar created by "package". Any ideas on how I'd do that using sbt?

p.s. if it helps any, I'm trying to use scala to write code for Hadoop, and I don't want to have to install and maintain scala installations across all the machines in my cluster.


Comment by, Apr 17, 2011
Comment by, Apr 20, 2011

Thank you that worked!

Powered by Google Project Hosting