- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Whats the best setup for Scala IDE + Lift + Maven?
Tue, 2009-05-05, 02:54
Can someone point me at or tell me, the current best setup for doing
Lift development using the Scala IDE for Eclipse on 2.7.4?
Eg what plugins and what update sites to use, any custom config needed, etc?
Im familiar with the Scala plugin, but not particularly familiar with
using Maven within Eclipse, nor with Lift.
If there isnt currently a write-up of this on a wiki somewhere, I
volunteer to do so if I get instructions that work for me.
-Ben
Tue, 2009-05-05, 13:27
#2
Re: Whats the best setup for Scala IDE + Lift + Maven?
I got things working today using Eclipse + Scala plugin + Q4E (IAM
predecessor) + Lift archetype, with only one issue, which turned out to
be an overly loose version constraint in the Lift POM's dependency
declaration on Jetty.
Along the way, I pondered Josh's Scala-Maven integration, m2eclipse, and
unsuccessfully navigated IAM's awful Eclipse Incubator website, never
finding its update url.
As this and other recent threads on this list show, its useful/important
to capture:
- Which tools & versions work well together
- Where to get them
- Any common problems or non-obvious tweaks needed.
The info about /working on/ the Scala Eclipse plugin seems pretty good
in this regard [http://lampsvn.epfl.ch/trac/scala/wiki/EclipsePlugin].
But we need something similar for /doing Scala development with the
plugin/. The main newbie entry point [http://www.scala-lang.org/node/94]
(a) currently links just to the above contributor page, (b) cannot be
edited via trac account, limiting the community's ability to help
maintain it.
I propose a simple change: it instead links to a new trac "Scala IDE for
Eclipse lobby" page, which then links to the contributor page above,
plus the FAQ, the (nascent) architecture page, and the "Using the Scala
IDE for Eclipse with Maven" and "Using the Scala IDE for Eclipse for
Lift development" pages that I'll create, if this advice is heeded :)
Also, back links to the lobby from each sub-page would help newcomers
move around.
-Ben
Naftoli Gugenheim wrote:
> Currently I'm using eclipse + IAM + lift archetype + GAE SDK (not the
> plugin), and things are smooth.
> Before I was using m2eclipse, and although it's more stable, it seems
> to like using indexes. I couldn't get the archetype 1.1-SNAPSHOT,
> which is apparently recommended for use with GAE, without IAM.
> One issue that I have, which is really a maven issue, is that whenever
> I use my computer offline maven discovers that it needs something it
> didn't get yet.
> Another issue is that when IAM runs jetty:run inside eclipse's JVM
> (which doesn't seem to be currently changeable) you can't stop it.
> That's not the biggest issue with the maven jetty plugin or other
> jetty setups that scan for changes and reload the app, but GAE's dev
> server doesn't seem to do that (although it uses jetty). A workaround
> is to setup jetty manually as an eclipse launch configuration (in an
> external VM).
> Another issue was some kind of error about windows\_jline.dll alroady
> being loaded. Taking the scala maven plugin out of the POM (not sure
> if it was from reporting, compiling, or both) and using the eclipse
> scala builder instead worked fine (set the correct output directory).
> As I mentioned before, often I'm working offline after some change to
> the setup, and in this case I noticed that the lift/GAE instructions
> said to use mvn package to get your directories in the right format
> for GAE (i.e. standard WAR layout), but maven needed some download. So
> I wrote a little ant buildfile that, in the final version, contained a
> target to copy (a) classes folder to WEB-INF/classes, (b) webapp to
> war dir, and (c) all the libraries to the lib folder. For (c), select
> the libs in the maven classpath in Project Explorer, copy, got to the
> ant file and paste. You should get the full paths of your libraries.
> Put them in a filelist, but cut out the common root (i.e. the maven
> repository location) and put it into the dir attribute. Make sure that
> you remove jetty and jetty-util.
> The next target, dependent on the first, contained some workarounds
> for GAE, because for some reason on my system, after launching the dev
> server via eclipse, I was able to stop it but not close the console
> window for it -- doing so froze eclipse until I end-tasked the
> java(w).exe for GAE. So I run in parallel, (a) a command prompt window
> that runs GAE, and (b) for the convenience, it first waits for the
> server to be working, then launches the browser to localhost:8080. I'm
> attaching the file. Enjoy!
>
>
>
> On Mon, May 4, 2009 at 9:54 PM, Ben Hutchison > wrote:
>
> Can someone point me at or tell me, the current best setup for doing
> Lift development using the Scala IDE for Eclipse on 2.7.4?
>
> Eg what plugins and what update sites to use, any custom config
> needed, etc?
>
> Im familiar with the Scala plugin, but not particularly familiar with
> using Maven within Eclipse, nor with Lift.
>
> If there isnt currently a write-up of this on a wiki somewhere, I
> volunteer to do so if I get instructions that work for me.
>
> -Ben
>
>
Tue, 2009-05-05, 13:47
#3
Re: Whats the best setup for Scala IDE + Lift + Maven?
On Tue, May 5, 2009 at 8:26 AM, Ben Hutchison <ben@playscapegames.com> wrote:
I got things working today using Eclipse + Scala plugin + Q4E (IAM predecessor) + Lift archetype, with only one issue, which turned out to be an overly loose version constraint in the Lift POM's dependency declaration on Jetty.
Along the way, I pondered Josh's Scala-Maven integration, m2eclipse, and unsuccessfully navigated IAM's awful Eclipse Incubator website, never finding its update url.
Yeah, this is a known problem. The fun part here is IAM was ready to be released, but it's still under IP legal review, and therefore they're releasing a new Q. I believe part of that release will be an update to the website. My maven-scala integration is still in hiatus. Basically, the main reason for is existence is not quite a "pain point" as it was when I started it. With careful use of right-click menu options on package explorer, you can get your project running pretty smoothly. The goal of ESMi would be to provide glue between the various means of creating a project: "Create Scala Project, then Enable maven dependency management, then fix build path", "Import Maven Project then add Scala nature then fix build path" or "Create Java Project, Add Scala nature, Enable Maven dependency management then fix build path" (my current choice).
As this and other recent threads on this list show, its useful/important to capture:
- Which tools & versions work well together
- Where to get them
- Any common problems or non-obvious tweaks needed.
This sounds like a good FAQ to create. I actually thought about starting this on my wiki when you first mentioned it. Using the scala trac wiki would be more ideal if someone can set up the permissions for us ;)
The info about /working on/ the Scala Eclipse plugin seems pretty good in this regard [http://lampsvn.epfl.ch/trac/scala/wiki/EclipsePlugin].
But we need something similar for /doing Scala development with the plugin/. The main newbie entry point [http://www.scala-lang.org/node/94] (a) currently links just to the above contributor page, (b) cannot be edited via trac account, limiting the community's ability to help maintain it.
I propose a simple change: it instead links to a new trac "Scala IDE for Eclipse lobby" page, which then links to the contributor page above, plus the FAQ, the (nascent) architecture page, and the "Using the Scala IDE for Eclipse with Maven" and "Using the Scala IDE for Eclipse for Lift development" pages that I'll create, if this advice is heeded :)
Great idea go for it! I can contribute my experience with various maven toolings. I'm using maven, eclipse and scala daily at work, so hopefully I can capture whatever knowledge I've built up to help out the rest of the community.
Also, back links to the lobby from each sub-page would help newcomers move around.
-Ben
Naftoli Gugenheim wrote:
Currently I'm using eclipse + IAM + lift archetype + GAE SDK (not the plugin), and things are smooth.
Before I was using m2eclipse, and although it's more stable, it seems to like using indexes. I couldn't get the archetype 1.1-SNAPSHOT, which is apparently recommended for use with GAE, without IAM.
One issue that I have, which is really a maven issue, is that whenever I use my computer offline maven discovers that it needs something it didn't get yet.
Another issue is that when IAM runs jetty:run inside eclipse's JVM (which doesn't seem to be currently changeable) you can't stop it. That's not the biggest issue with the maven jetty plugin or other jetty setups that scan for changes and reload the app, but GAE's dev server doesn't seem to do that (although it uses jetty). A workaround is to setup jetty manually as an eclipse launch configuration (in an external VM).
Another issue was some kind of error about windows\_jline.dll alroady being loaded. Taking the scala maven plugin out of the POM (not sure if it was from reporting, compiling, or both) and using the eclipse scala builder instead worked fine (set the correct output directory).
As I mentioned before, often I'm working offline after some change to the setup, and in this case I noticed that the lift/GAE instructions said to use mvn package to get your directories in the right format for GAE (i.e. standard WAR layout), but maven needed some download. So I wrote a little ant buildfile that, in the final version, contained a target to copy (a) classes folder to WEB-INF/classes, (b) webapp to war dir, and (c) all the libraries to the lib folder. For (c), select the libs in the maven classpath in Project Explorer, copy, got to the ant file and paste. You should get the full paths of your libraries. Put them in a filelist, but cut out the common root (i.e. the maven repository location) and put it into the dir attribute. Make sure that you remove jetty and jetty-util.
The next target, dependent on the first, contained some workarounds for GAE, because for some reason on my system, after launching the dev server via eclipse, I was able to stop it but not close the console window for it -- doing so froze eclipse until I end-tasked the java(w).exe for GAE. So I run in parallel, (a) a command prompt window that runs GAE, and (b) for the convenience, it first waits for the server to be working, then launches the browser to localhost:8080. I'm attaching the file. Enjoy!
On Mon, May 4, 2009 at 9:54 PM, Ben Hutchison <ben@playscapegames.com <mailto:ben@playscapegames.com>> wrote:
Can someone point me at or tell me, the current best setup for doing
Lift development using the Scala IDE for Eclipse on 2.7.4?
Eg what plugins and what update sites to use, any custom config
needed, etc?
Im familiar with the Scala plugin, but not particularly familiar with
using Maven within Eclipse, nor with Lift.
If there isnt currently a write-up of this on a wiki somewhere, I
volunteer to do so if I get instructions that work for me.
-Ben
Tue, 2009-05-05, 14:17
#4
Re: Whats the best setup for Scala IDE + Lift + Maven?
On Tue, May 5, 2009 at 1:26 PM, Ben Hutchison wrote:
> I propose a simple change: it instead links to a new trac "Scala IDE for
> Eclipse lobby" page, which then links to the contributor page above, plus
> the FAQ, the (nascent) architecture page, and the "Using the Scala IDE for
> Eclipse with Maven" and "Using the Scala IDE for Eclipse for Lift
> development" pages that I'll create, if this advice is heeded :)
Excellent idea!
I've created the following three pages,
http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
and asked for them to be made writable by anyone with a Trac login ...
Cheers,
Miles
Tue, 2009-05-05, 14:37
#5
Re: Whats the best setup for Scala IDE + Lift + Maven?
On Tue, May 5, 2009 at 2:10 PM, Miles Sabin wrote:
> I've created the following three pages,
>
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>
> and asked for them to be made writable by anyone with a Trac login ...
Permissions should be sorted out now, so have at it :-)
Cheers,
Miles
Tue, 2009-05-05, 17:37
#6
Re: Whats the best setup for Scala IDE + Lift + Maven?
Hmm. I tried adding a new dependency (I'm using IAM) and now I can't get the Maven classpath container to show up (it's listed in .classpath). I'm now trying to uninstall and reinstall it...
On Tue, May 5, 2009 at 9:32 AM, Miles Sabin <miles@milessabin.com> wrote:
On Tue, May 5, 2009 at 9:32 AM, Miles Sabin <miles@milessabin.com> wrote:
On Tue, May 5, 2009 at 2:10 PM, Miles Sabin <miles@milessabin.com> wrote:
> I've created the following three pages,
>
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>
> and asked for them to be made writable by anyone with a Trac login ...
Permissions should be sorted out now, so have at it :-)
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://twitter.com/milessabin
Tue, 2009-05-05, 18:57
#7
Re: Whats the best setup for Scala IDE + Lift + Maven?
I guess IAM is buggy. I couldn't install Q4E, SWT version mismatch? So I switched back to m2eclipse...
On Tue, May 5, 2009 at 12:34 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
On Tue, May 5, 2009 at 12:34 PM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
Hmm. I tried adding a new dependency (I'm using IAM) and now I can't get the Maven classpath container to show up (it's listed in .classpath). I'm now trying to uninstall and reinstall it...
On Tue, May 5, 2009 at 9:32 AM, Miles Sabin <miles@milessabin.com> wrote:On Tue, May 5, 2009 at 2:10 PM, Miles Sabin <miles@milessabin.com> wrote:
> I've created the following three pages,
>
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>
> and asked for them to be made writable by anyone with a Trac login ...
Permissions should be sorted out now, so have at it :-)
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://twitter.com/milessabin
Wed, 2009-05-06, 00:37
#8
Re: Whats the best setup for Scala IDE + Lift + Maven?
Hi Naftoli,
In the context of putting good, working advice which tools work (now)
on the wiki:
1. What version of IAM did you use, and where do you get it from?
Would like to test it out myself sometime.
2. Ive not yet had any problems with my setup. Lift builds and runs
ok. I'll try adding a maven dependency to q4e 0.81. If that works,
shall we tentatively advise using q4e 0.81 with Scala IDE 2.7.4 and
Lift 1.0 as a working config?
-Ben
On Wed, May 6, 2009 at 3:51 AM, Naftoli Gugenheim wrote:
> I guess IAM is buggy. I couldn't install Q4E, SWT version mismatch? So I
> switched back to m2eclipse...
>
> On Tue, May 5, 2009 at 12:34 PM, Naftoli Gugenheim
> wrote:
>>
>> Hmm. I tried adding a new dependency (I'm using IAM) and now I can't get
>> the Maven classpath container to show up (it's listed in .classpath). I'm
>> now trying to uninstall and reinstall it...
>>
>> On Tue, May 5, 2009 at 9:32 AM, Miles Sabin wrote:
>>>
>>> On Tue, May 5, 2009 at 2:10 PM, Miles Sabin wrote:
>>> > I've created the following three pages,
>>> >
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>>> >
>>> > and asked for them to be made writable by anyone with a Trac login ...
>>>
>>> Permissions should be sorted out now, so have at it :-)
>>>
>>> Cheers,
>>>
>>>
>>> Miles
>>>
>>> --
>>> Miles Sabin
>>> tel: +44 (0)7813 944 528
>>> skype: milessabin
>>> http://twitter.com/milessabin
>>
>
>
Wed, 2009-05-06, 01:47
#9
Re: Whats the best setup for Scala IDE + Lift + Maven?
I'm using q4e 0.8.1 with Scala IDE 2.8.0 nightly, and things appear to be working fine. You do need to ensure that you install the scala plugin first.
Instead of uninstalling q4e, did you check the error view to see why the maven classpath wasn't showing up? Usually there's some reason (q4e unfortunately marks the first-line of the pom.xml with all the errors from the classpath resolution).
-Josh
On Tue, May 5, 2009 at 7:35 PM, Ben Hutchison <ben@playscapegames.com> wrote:
Instead of uninstalling q4e, did you check the error view to see why the maven classpath wasn't showing up? Usually there's some reason (q4e unfortunately marks the first-line of the pom.xml with all the errors from the classpath resolution).
-Josh
On Tue, May 5, 2009 at 7:35 PM, Ben Hutchison <ben@playscapegames.com> wrote:
Hi Naftoli,
In the context of putting good, working advice which tools work (now)
on the wiki:
1. What version of IAM did you use, and where do you get it from?
Would like to test it out myself sometime.
2. Ive not yet had any problems with my setup. Lift builds and runs
ok. I'll try adding a maven dependency to q4e 0.81. If that works,
shall we tentatively advise using q4e 0.81 with Scala IDE 2.7.4 and
Lift 1.0 as a working config?
-Ben
On Wed, May 6, 2009 at 3:51 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
> I guess IAM is buggy. I couldn't install Q4E, SWT version mismatch? So I
> switched back to m2eclipse...
>
> On Tue, May 5, 2009 at 12:34 PM, Naftoli Gugenheim <naftoligug@gmail.com>
> wrote:
>>
>> Hmm. I tried adding a new dependency (I'm using IAM) and now I can't get
>> the Maven classpath container to show up (it's listed in .classpath). I'm
>> now trying to uninstall and reinstall it...
>>
>> On Tue, May 5, 2009 at 9:32 AM, Miles Sabin <miles@milessabin.com> wrote:
>>>
>>> On Tue, May 5, 2009 at 2:10 PM, Miles Sabin <miles@milessabin.com> wrote:
>>> > I've created the following three pages,
>>> >
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>>> >
>>> > and asked for them to be made writable by anyone with a Trac login ...
>>>
>>> Permissions should be sorted out now, so have at it :-)
>>>
>>> Cheers,
>>>
>>>
>>> Miles
>>>
>>> --
>>> Miles Sabin
>>> tel: +44 (0)7813 944 528
>>> skype: milessabin
>>> http://twitter.com/milessabin
>>
>
>
Fri, 2009-05-08, 17:37
#10
Re: Whats the best setup for Scala IDE + Lift + Maven?
I think the update URL is on Q4E's Google Code wiki. Could be it's same as Q4E but .../update-dev instead of .../update. But like I said, it's seems to be buggy. I just couldn't figure out how to get a snapshot version of an archetype in m2eclipse, but after I get the project set up I switched back to m2ecipse because after adding a dependency in IAM the whole Maven classpath container disappeared from the project!
On Tue, May 5, 2009 at 7:35 PM, Ben Hutchison <ben@playscapegames.com> wrote:
On Tue, May 5, 2009 at 7:35 PM, Ben Hutchison <ben@playscapegames.com> wrote:
Hi Naftoli,
In the context of putting good, working advice which tools work (now)
on the wiki:
1. What version of IAM did you use, and where do you get it from?
Would like to test it out myself sometime.
2. Ive not yet had any problems with my setup. Lift builds and runs
ok. I'll try adding a maven dependency to q4e 0.81. If that works,
shall we tentatively advise using q4e 0.81 with Scala IDE 2.7.4 and
Lift 1.0 as a working config?
-Ben
On Wed, May 6, 2009 at 3:51 AM, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
> I guess IAM is buggy. I couldn't install Q4E, SWT version mismatch? So I
> switched back to m2eclipse...
>
> On Tue, May 5, 2009 at 12:34 PM, Naftoli Gugenheim <naftoligug@gmail.com>
> wrote:
>>
>> Hmm. I tried adding a new dependency (I'm using IAM) and now I can't get
>> the Maven classpath container to show up (it's listed in .classpath). I'm
>> now trying to uninstall and reinstall it...
>>
>> On Tue, May 5, 2009 at 9:32 AM, Miles Sabin <miles@milessabin.com> wrote:
>>>
>>> On Tue, May 5, 2009 at 2:10 PM, Miles Sabin <miles@milessabin.com> wrote:
>>> > I've created the following three pages,
>>> >
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaIDEForEclipse
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
>>> > http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>>> >
>>> > and asked for them to be made writable by anyone with a Trac login ...
>>>
>>> Permissions should be sorted out now, so have at it :-)
>>>
>>> Cheers,
>>>
>>>
>>> Miles
>>>
>>> --
>>> Miles Sabin
>>> tel: +44 (0)7813 944 528
>>> skype: milessabin
>>> http://twitter.com/milessabin
>>
>
>
One issue that I have, which is really a maven issue, is that whenever I use my computer offline maven discovers that it needs something it didn't get yet.Another issue is that when IAM runs jetty:run inside eclipse's JVM (which doesn't seem to be currently changeable) you can't stop it. That's not the biggest issue with the maven jetty plugin or other jetty setups that scan for changes and reload the app, but GAE's dev server doesn't seem to do that (although it uses jetty). A workaround is to setup jetty manually as an eclipse launch configuration (in an external VM).
Another issue was some kind of error about windows\_jline.dll alroady being loaded. Taking the scala maven plugin out of the POM (not sure if it was from reporting, compiling, or both) and using the eclipse scala builder instead worked fine (set the correct output directory). As I mentioned before, often I'm working offline after some change to the setup, and in this case I noticed that the lift/GAE instructions said to use mvn package to get your directories in the right format for GAE (i.e. standard WAR layout), but maven needed some download. So I wrote a little ant buildfile that, in the final version, contained a target to copy (a) classes folder to WEB-INF/classes, (b) webapp to war dir, and (c) all the libraries to the lib folder. For (c), select the libs in the maven classpath in Project Explorer, copy, got to the ant file and paste. You should get the full paths of your libraries. Put them in a filelist, but cut out the common root (i.e. the maven repository location) and put it into the dir attribute. Make sure that you remove jetty and jetty-util. The next target, dependent on the first, contained some workarounds for GAE, because for some reason on my system, after launching the dev server via eclipse, I was able to stop it but not close the console window for it -- doing so froze eclipse until I end-tasked the java(w).exe for GAE. So I run in parallel, (a) a command prompt window that runs GAE, and (b) for the convenience, it first waits for the server to be working, then launches the browser to localhost:8080. I'm attaching the file. Enjoy!
On Mon, May 4, 2009 at 9:54 PM, Ben Hutchison <ben@playscapegames.com> wrote: