Help with the eclipse plugin

11 views
Skip to first unread message

Dan Gravell

unread,
Jul 9, 2009, 9:02:02 AM7/9/09
to Lift
I'm trying to learn about lift using the eclipse plugin but not really
getting far... Currently trying to build a project hangs eclipse which
is obviously something of a shortcoming.

Eclipse 3.4.2
Scala plugin 2.7.5
Maven plugin Q4E (IAM) 0.10....

So I create a new lift project externally using maven and the
instructions at http://wiki.liftweb.net/index.php/Chore_wheel (I
believe this is the way to do it, I've tried other approaches but I
didn't really find anything that could be classed as canonical) did a
'mvn eclipse:eclipse' and imported it into eclipse. That's when it
hangs, because Eclipse tries to build straight away.

It hangs when it says:

Starting mojoExecution scala:compile

... in the progress bar. Meanwhile, in a different VM I notice the
following process has begun:

/usr/java/jdk1.6.0_12/jre/bin/java -classpath /home/gravelld/.m2/
repository/org/scala-lang/scala-compiler/2.7.3/scala-
compiler-2.7.3.jar:/home/gravelld/.m2/repository/org/scala-lang/scala-
library/2.7.3/scala-library-2.7.3.jar:/home/gravelld/.m2/repository/
org/scala-tools/maven-scala-plugin/2.11/maven-scala-plugin-2.11.jar -
Xbootclasspath/a:/home/gravelld/.m2/repository/org/scala-lang/scala-
library/2.7.3/scala-library-2.7.3.jar
org.scala_tools.maven.executions.MainWithArgsInFile
scala.tools.nsc.Main /tmp/scala-maven-1418794117226686986.args

But this doesn't appear to complete. Is this what the eclipse builder
is waiting for? I can actually run the above from the command line and
it returns in a couple of seconds.

Interestingly, when working through the 'todo' example there was a
period when it appeared to work, but going back to it today appears to
show the same issue above.

Really hoping someone can help me out because this stuff looked
interesting.

Naftoli Gugenhem

unread,
Jul 9, 2009, 11:14:41 AM7/9/09
to dan.g...@talk21.com, lif...@googlegroups.com
mvn eclipse:eclipse doesn't seem to like scala. Why don't you initialize everything from the IAM GUI?

-------------------------------------

Ellis

unread,
Jul 9, 2009, 12:14:48 PM7/9/09
to Lift
Hi Dan,

I don't have an answer to your question, but maybe a suggestion.
Eclipse does not work well with maven/scala/lift, and I really doubt
it will anytime soon. According to exchanges on this list, IntelliJ
IDEA apparently has the best working implementation so far. I've been
using NetBeans 6.7 for a couple weeks now, and I like it better than
Eclipse (which I've used for years). It works a better with maven,
and a little bit better with scala. Neither environment handles
testing, debugging, or refactoring smoothly though.

Anyhow, with NetBeans you can just open the maven pom directly.
You'll have to create some custom "actions" in order to get your
programs to launch, and entering debug mode a bit of a pain.

Cheers,
Ellis

Kevin Wright

unread,
Jul 9, 2009, 12:27:23 PM7/9/09
to lif...@googlegroups.com
The fabled 2.8 eclipse plugin will be the one to use when it's here, should be any day now...

David Pollak

unread,
Jul 9, 2009, 12:45:41 PM7/9/09
to lif...@googlegroups.com
On Thu, Jul 9, 2009 at 9:27 AM, Kevin Wright <kev.lee...@googlemail.com> wrote:
The fabled 2.8 eclipse plugin will be the one to use when it's here, should be any day now...

This is normally my cue to rant about the state of the Eclipse plugin.  First some background... I've been part of the Scala community for nearly 3 years.  Ever since I joined the community, the "new, better, stable, working" Eclipse plugin was just a few months away.

Last year, Miles took over development of the plugin and has made significant progress... the plugin doesn't suck beyond all belief, it's now merely unstable and generally doesn't play well with the likes of Maven (when used from the command line).  Miles has relatively improved the plugin in amazing ways, but at the absolute level, there are still exceptions logged for mousing over virtually every element in my apps and I find Eclipse unusable for Lift or Lift-related development.

A few weeks ago, Martin Odersky announced that he was going to focus his efforts on the Eclipse plugin.  Martin is one of the best computer scientists and one of the best programmers in the world.  I am finally looking forward to excellent progress on the Eclipse plugin front.

But, until Martin's magic brain has yielded code for us, I would recommend avoiding Eclipse for Scala and Lift related development.

For newbies, I suggest using TextMate, Emacs, or vi.  You don't need much more for Lift development than those tools.  There's less to get in your way with a text editor.

I use 25% emacs, 60% NetBeans and 15% IntelliJ for my development.  My fingers know Emacs better than everything else.  NetBeans has the best error reporting of any of editors.  IntelliJ has the best code navigation and intellisense of any of the editors.

Thanks,

David

 



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

Miles Sabin

unread,
Jul 9, 2009, 12:57:04 PM7/9/09
to lif...@googlegroups.com
On Thu, Jul 9, 2009 at 5:45 PM, David
Pollak<feeder.of...@gmail.com> wrote:
> But, until Martin's magic brain has yielded code for us, I would recommend
> avoiding Eclipse for Scala and Lift related development.

Unsurprisingly I disagree.

Bug reports and more contributions to documentation on using Eclipse
with Lift and Maven would be much appreciated from the Lift community.
There's a start here,

http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven

but clearly a great deal more is needed. A little more encouragement
and a little less FUD wouldn't go amiss.

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin

Jeppe Nejsum Madsen

unread,
Jul 9, 2009, 1:05:16 PM7/9/09
to lif...@googlegroups.com
Ellis <ellis.w...@gmail.com> writes:

> Hi Dan,
>
> I don't have an answer to your question, but maybe a suggestion.
> Eclipse does not work well with maven/scala/lift, and I really doubt
> it will anytime soon.

I don't know about the Maven part, but Eclipse works with Scala &
Lift. It's not nearly as functional as with Java, but I can edit,
compile and debug without too much trouble. Advanced stuff such as
completion, navigation etc. doesn't seem to work that well and I
sometimes need to do a "clean all" to get back into a working state

I'm using it daily without major pain, but await the 2.8 plugin (when
Lift moves to 2.8 :-)

I don't like Maven, so only use it to bootstrap the project. These steps works
for me (Eclipse EE 3.5, Scala 2.7.5):

mvn archetype:create -U -DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-basic \
-DarchetypeVersion=1.1-SNAPSHOT \
-DremoteRepositories=http://scala-tools.org/repo-snapshots \
-DgroupId=demo.helloworld -DartifactId=helloworld -Dversion=1.1-SNAPSHOT

verify it works: mvn jetty:run
Press Ctrl-C to stop
mvn eclipse:eclipse

In Eclipse:
- If you haven't already: Define M2_REPO classpath var to point to your
local maven repo (~/.m2/repository)
- Import the project you just created above
- Eclipse plugin don't like multiple output folders so modify your
projects build path
* Remove all existing source folders
* Add the source folders src/main/scala, src/main/resources,
src/test/scala & src/test/resources, all with the same output folder
- Clean the project
- You can now launch src/test/RunWebApp as a Scala Application to have
jetty run inside eclipse and you can run debug etc
- Running specs with the Eclipse JUnit runner is possible but requires a
workaround, see the specs site.

/Jeppe

Jeppe Nejsum Madsen

unread,
Jul 9, 2009, 1:14:32 PM7/9/09
to lif...@googlegroups.com
Miles Sabin <mi...@milessabin.com> writes:

> On Thu, Jul 9, 2009 at 5:45 PM, David
> Pollak<feeder.of...@gmail.com> wrote:
>> But, until Martin's magic brain has yielded code for us, I would recommend
>> avoiding Eclipse for Scala and Lift related development.
>
> Unsurprisingly I disagree.
>
> Bug reports and more contributions to documentation on using Eclipse
> with Lift and Maven would be much appreciated from the Lift community.
> There's a start here,
>
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
> http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
>
> but clearly a great deal more is needed. A little more encouragement
> and a little less FUD wouldn't go amiss.

A major show stopper atm is that Lift, afaik, doesn't work with Scala
2.8 which makes it difficult to actually use the trunk plugin. It is my
(maybe incorrect?) impression that there's not a lot of activity
happening on the 2.7.5 plugin....

/Jeppe

Miles Sabin

unread,
Jul 9, 2009, 1:24:32 PM7/9/09
to lif...@googlegroups.com
On Thu, Jul 9, 2009 at 6:14 PM, Jeppe Nejsum Madsen<je...@ingolfs.dk> wrote:
> A major show stopper atm is that Lift, afaik, doesn't work with Scala
> 2.8 which makes it difficult to actually use the trunk plugin. It is my
> (maybe incorrect?) impression that there's not a lot of activity
> happening on the 2.7.5 plugin....

All the current activity is on trunk ...

Nevertheless there are many mostly happy users of 2.7.5 for Lift and
general Scala development work.

Cheers,


Miles

--
Miles S4abin

David Pollak

unread,
Jul 9, 2009, 1:32:46 PM7/9/09
to lif...@googlegroups.com
On Thu, Jul 9, 2009 at 10:14 AM, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:

Miles Sabin <mi...@milessabin.com> writes:

> On Thu, Jul 9, 2009 at 5:45 PM, David
> Pollak<feeder.of...@gmail.com> wrote:
>> But, until Martin's magic brain has yielded code for us, I would recommend
>> avoiding Eclipse for Scala and Lift related development.
>
> Unsurprisingly I disagree.
>
> Bug reports and more contributions to documentation on using Eclipse
> with Lift and Maven would be much appreciated from the Lift community.
> There's a start here,
>
>   http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
>   http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven
>
> but clearly a great deal more is needed. A little more encouragement
> and a little less FUD wouldn't go amiss.

A major show stopper atm is that Lift, afaik, doesn't work with Scala
2.8 which makes it difficult to actually use the trunk plugin.

Lift relies on Specs.  As of a week ago, scalac could not compile Specs or Lift because of compiler problems.  Jorge is working on this, but it'll be a little while before we have a branch of Lift that is on 2.8.
 
It is my
(maybe incorrect?) impression that there's not a lot of activity
happening on the 2.7.5 plugin....

/Jeppe


Naftoli Gugenhem

unread,
Jul 9, 2009, 1:50:46 PM7/9/09
to mi...@milessabin.com, lif...@googlegroups.com
I'm using eclipse for lift. I'm not saying it's perfect but it's very usable. My understanding is that the important thing is not to use mv eclipse:eclipse.

-------------------------------------
Miles Sabin<mi...@milessabin.com> wrote:


On Thu, Jul 9, 2009 at 5:45 PM, David
Pollak<feeder.of...@gmail.com> wrote:
> But, until Martin's magic brain has yielded code for us, I would recommend
> avoiding Eclipse for Scala and Lift related development.

Unsurprisingly I disagree.

Bug reports and more contributions to documentation on using Eclipse
with Lift and Maven would be much appreciated from the Lift community.
There's a start here,

http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseLift
http://lampsvn.epfl.ch/trac/scala/wiki/ScalaEclipseMaven

but clearly a great deal more is needed. A little more encouragement
and a little less FUD wouldn't go amiss.

Cheers,


Miles

--
Miles Sabin

Naftoli Gugenhem

unread,
Jul 9, 2009, 1:59:34 PM7/9/09
to je...@ingolfs.dk, lif...@googlegroups.com
Completion works for me, when there are no basic syntax errors in the file (mismatched bracketd etc.).
Also, I use lift without running maven from the command line. I create the project with m2eclipse, and I don't recall having to set M2_REPO.

-------------------------------------
Jeppe Nejsum Madsen<je...@ingolfs.dk> wrote:


Jeppe Nejsum Madsen

unread,
Jul 9, 2009, 2:06:03 PM7/9/09
to Naftoli Gugenhem, lif...@googlegroups.com
Naftoli Gugenhem <nafto...@gmail.com> writes:

> Completion works for me, when there are no basic syntax errors in the file (mismatched bracketd etc.).
> Also, I use lift without running maven from the command line. I create the project with m2eclipse, and I don't recall having to set M2_REPO.
>

The M2_REPO var is used by the .classpath generated by
mvn eclipse:eclipse

/Jeppe

Dan Gravell

unread,
Jul 9, 2009, 4:00:19 PM7/9/09
to Lift
Ok... my feelings are that is not so much the scala stuff as the maven
plugin that was borking eclipse. So I took Jeppe's advice, which seems
to be to use maven outside of eclipse. At least it doesn't seem to
hang anymore, which is a significant step forward!

Thanks everyone for their thoughts. Time to prepare some coffee!

Dan

Naftoli Gugenheim

unread,
Jul 9, 2009, 4:05:29 PM7/9/09
to lif...@googlegroups.com
So maybe we can say... either use it only outside or only inside...
Reply all
Reply to author
Forward
0 new messages