I thought maybe someone should start a thread for those who are using SBT to build Vaadin projects. There’s a few gotchas and places to get tripped up in an SBT Scaladin / Vaadin project. I’ll start off by giving my experience in adding DontPush OzoneLayer to an SBT project. Here’s what I wrote to the SBT mailing list, and I’m putting it here for future Vaadin users.
DontPush OzoneLayer) can be added to the sbt dependencies like so:
libraryDependencies ++= Seq(etc, “org.vaadin” % “dontpush-addon-ozonelayer” % “0.4.6”, etc.)
The problem is that for some reason Jetty gives the following exceptions:
org.eclipse.jetty.servlet.ServletHolder$1: java.lang.reflect.InvocationTargetException
… and so on, until:
Caused by: java.lang.UnsupportedOperationException: Please remove the atmosphere-compat-jetty from your classpath
Okay, so I add:
“org.vaadin” % “dontpush-addon-ozonelayer” % “0.4.6” exclude(“org.atmosphere”, “atmosphere-compat-jetty”)
But, that doesn’t exclude the atmosphere-compat-jetty from the lib_managed folder (I’ve set retrieveManaged := true) or the build (I still get the same error). Just to check to see if it was this dependency that was transitively bringing in the atmosphere-compat-jetty jar, I set:
“org.vaadin” % “dontpush-addon-ozonelayer” % “0.4.6” intransitive()
And that excluded it. And all the other jars it needs as well, of course. So, how to solve it? According to the old googlecode sbt pages I found a way to manually use the ivy xml to set the exclusion:
ivyXML :=
And that works. So, I guess the exclude() function isn’t working correctly? Or am I using it wrong? Although the sbt wiki is getting better, I wish it had a simple search box and more examples.
For future Vaadin / atmosphere users, you then have to add a second dependency after excluding that module:
“org.eclipse.jetty” % “jetty-websocket” % “8.0.1.v20110908”
After that it all works fine. Hope this helps folks in the future.