1. Download Kobalt

Download the zip file then unzip it in a location we'll call KOBALT_HOME:

cd $KOBALT_HOME
unzip kobalt-xxx.zip

2. Initialize your project for Kobalt

Change to your project directory and call the kobaltw command with --init:

cd ~/java/project
$KOBALT_HOME/kobaltw --init

This command will do two things:

  1. Create a default kobalt/src/Build.kt file based on what was found there.
  2. Install the Kobalt Wrapper in your current directory (script `kobaltw`) and in the kobalt/ directory. From now on, you can just use ./kobaltw to build and you can ignore $KOBALT_HOME.

You can now attempt to build your project with Kobalt:

./kobaltw assemble
If your project follows a regular build structure (e.g. Maven's hierarchy), this should compile your file and create a .jar file. If not, you will have to make a few edits to your Build.kt. As of this writing, Kobalt supports Java and Kotlin projects.

3. Edit kobalt/src/Build.kt

Here for example is the Build.kt for wasabi http framework
import com.beust.kobalt.*
import com.beust.kobalt.plugin.packaging.assemble
import com.beust.kobalt.plugin.kotlin.*

val kotlin_version = "1.0.0-beta-4583"

val p = kotlinProject {

    name = "wasabi"
    group = "com.example"
    artifactId = name
    version = "0.1"

    //tells Kobalt to also search here for dependencies
    val repos = repos("http://oss.sonatype.org/content/repositories/snapshots") 

    dependencies {
        compile("org.jetbrains.kotlin:kotlin-stdlib:" + kotlin_version,
            "org.jetbrains.kotlin:kotlin-reflect:" + kotlin_version,
            "com.fasterxml.jackson.core:jackson-core:2.6.4",
            "com.fasterxml.jackson.core:jackson-databind:2.6.4",
            "com.fasterxml.jackson.core:jackson-annotations:2.6.4",
            "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.6.3",
            "com.fasterxml.woodstox:woodstox-core:5.0.1",

            "io.netty:netty-all:4.0.31.Final",
            "commons-codec:commons-codec:1.6",
            "commons-logging:commons-logging:1.1.1",
            "com.netflix.rxjava:rxjava-core:0.20.0-RC4",
            "org.slf4j:slf4j-api:1.7.5",
            "org.slf4j:slf4j-simple:1.7.5",
            "joda-time:joda-time:2.3")
    }

    //these are only downloaded when running the test task
    dependenciesTest {
        compile("junit:junit:4.9",
            "org.mockito:mockito-all:1.9.5",
            "org.apache.httpcomponents:httpcore:4.3.3",
            "org.apache.httpcomponents:httpclient:4.5.1")
    }

    //tells kobalt to produce a jar
    assemble {
        jar {
        }
    }
}

4. In Intellij IDEA, Sync Build File

If you're using Intellij IDEA, make sure you've installed the Kobalt plugin and then go to Kobalt -> Sync Build File. This will download dependencies in a way that IDEA understand so you no loger get errors.