How to use local SNAPSHOT build in SBT

435 views
Skip to first unread message

Maarten Koopmans

unread,
Jan 14, 2011, 6:06:08 AM1/14/11
to Lif...@googlegroups.com
Hi,

In testing a ticket, I made a full build with mvn  of the branch with the fix. When I then ran sbt update, the jar was not copied from my maven repo, but downloaded from scala-tools.org (and as it was lift-webkit...)

So I ended up copying the jar to lib_managed myself to test it. But surely I am missing something...

Here's what my SBT project file looks like:

import sbt._

class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {

  val mavenLocal = "Local Maven Repository" at
  "file://"+Path.userHome+"/.m2/repository"

  val scalatools_snapshot = "Scala Tools Snapshot" at

  val scalatools_release = "Scala Tools Snapshot" at

  val liftVersion = "2.3-SNAPSHOT"

  // uncomment the following if you want to use the snapshot repo
  // val scalatoolsSnapshot = ScalaToolsSnapshots

  // If you're using JRebel for Lift development, uncomment
  // this line
  // override def scanDirectories = Nil

  val mysql = "mysql" % "mysql-connector-java" % "5.1.12"

  override def libraryDependencies = Set(
    "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default",
    "net.liftweb" %% "lift-mapper" % liftVersion % "compile->default",
  "net.liftweb" %% "lift-wizard" % liftVersion % "compile->default",
  "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default",
    "junit" % "junit" % "4.5" % "test->default",
    "ch.qos.logback" % "logback-classic" % "0.9.26",
    "org.scala-tools.testing" %% "specs" % "1.6.6" % "test->default",
    "com.h2database" % "h2" % "1.2.138"
  ) ++ super.libraryDependencies
}

Any thoughts? Then I can put this in a Wiki under "How to test fixes for tickets".

--Maarten

Maarten Koopmans

unread,
Jan 14, 2011, 7:11:28 AM1/14/11
to Lif...@googlegroups.com
Got it: it's already in the build file as per the comments in the exampke I posted. Changing it to:

  val mavenLocal = "Local Maven Repository" at
  "file://"+Path.userHome+"/.m2/repository"

  // uncomment the following if you want to use the snapshot repo
  val scalatoolsSnapshot = ScalaToolsSnapshots

  // If you're using JRebel for Lift development, uncomment
  // this line
  // override def scanDirectories = Nil

  val liftVersion = "2.3-SNAPSHOT"

...worked like a charm...

--Maarten

TylerWeir

unread,
Jan 14, 2011, 8:51:36 AM1/14/11
to lif...@googlegroups.com, Lif...@googlegroups.com
Toss that on the wiki somewhere please.

Naftoli Gugenheim

unread,
Jan 14, 2011, 3:16:09 PM1/14/11
to liftweb
What was the change?


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Chris Reeves

unread,
Jan 14, 2011, 3:30:01 PM1/14/11
to lif...@googlegroups.com
Looks like uncommenting the scalatools snapshots repo line and making
sure the lift version is set to #.#-SNAPSHOT. At least that's how I've
used non-Lift artifact snapshots in the past.

Thanks, Chris

Chris Reeves

unread,
Jan 14, 2011, 3:41:03 PM1/14/11
to lif...@googlegroups.com
Oops, I misread. Here is the only difference that I see, but I have no
idea what it would actually accomplish.

val scalatoolsSnapshot = ScalaToolsSnapshots

Thanks, Chris

Maarten Koopmans

unread,
Jan 17, 2011, 7:22:16 AM1/17/11
to lif...@googlegroups.com

David Bernard

unread,
Jan 17, 2011, 8:24:04 AM1/17/11
to Lift
I'm not an SBT users (so I'm may be wrong).

From what I read (on the wiki), I think there is a confusion

If you enable the snapshot repository of scala-tools.org by
uncommenting

val scalatoolsSnapshot = ScalaToolsSnapshots

Then snapshots jar are toke from this repository, in this case it's
useless to git clone + build lift

If you want to use a locally compiled version of lift, you should
diseable (keep commenting) the snapshots repository of scala-tools.org
and enable your local maven repository (~/.m2/repository) where maven
install lift when you run "mvn clean install".

/davidB

On Jan 17, 1:22 pm, Maarten Koopmans <maarten.koopm...@gmail.com>
wrote:
> http://www.assembla.com/wiki/show/liftweb/Testing_and_Development_aga...
>
>
>
>
>
>
>
> On Fri, Jan 14, 2011 at 9:41 PM, Chris Reeves <ch...@ev-soft.net> wrote:
> > Oops, I misread. Here is the only difference that I see, but I have no
> > idea what it would actually accomplish.
>
> > val scalatoolsSnapshot = ScalaToolsSnapshots
>
> > Thanks, Chris
>
> > On Fri, Jan 14, 2011 at 3:30 PM, Chris Reeves <ch...@ev-soft.net> wrote:
> > > Looks like uncommenting the scalatools snapshots repo line and making
> > > sure the lift version is set to #.#-SNAPSHOT. At least that's how I've
> > > used non-Lift artifact snapshots in the past.
>
> > > Thanks, Chris
>
> > > On Fri, Jan 14, 2011 at 3:16 PM, Naftoli Gugenheim <naftoli...@gmail.com>
> > >>> liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/liftweb?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "Lift" group.
> > >> To post to this group, send email to lif...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .

Maarten Koopmans

unread,
Jan 17, 2011, 11:14:50 AM1/17/11
to lif...@googlegroups.com
Good catch. What you need to do is also add this line to the to of you SBT project file:

 val mavenLocal = "Local Maven Repository" at
  "file://"+Path.userHome+"/.m2/repository"

But without the uncommenting, it wouldn't work for me. I am updating the wiki.

--Maarten

To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

Tim Nelson

unread,
Jan 17, 2011, 12:06:54 PM1/17/11
to lif...@googlegroups.com
Hi Maarten,

If you want to use the snapshot version, there's no need to clone the repo and build it yourself. Every time a change is committed, Lift is automatically built and available in the Scala tools snapshot repo. All you need to do is add/uncomment the val scalatoolsSnapshot = ScalaToolsSnapshots line in your project file and change the version to 2.x-SNAPSHOT.

The only reason you would need to use the local repo is if you made changes yourself to Lift and wanted to use them.

Also, these 2 lines do the same thing:

 val scalatools_snapshot = "Scala Tools Snapshot" at

val scalatoolsSnapshot = ScalaToolsSnapshots

Just thought I'd mention that since they were both in your original post.

Tim

Maarten Koopmans

unread,
Jan 17, 2011, 12:30:21 PM1/17/11
to lif...@googlegroups.com
Hi Tim,

Thanks. But the wiki page is precisely about testing fixes on a not-commited branch. I ran int this initial set up thing when Derek asked me to test the fix for large uploads (or actually, all uploads), so I'd thought I'd share it. My goal was to make it easy for any developer to test a fix, so that part can be offloaded a bit from the core team.

--Maarten

--

Tim Nelson

unread,
Jan 17, 2011, 12:59:22 PM1/17/11
to lif...@googlegroups.com
Hi Maarten,

Sorry, I completely misread that.

Tim
Reply all
Reply to author
Forward
0 new messages