TUTORIAL: java + scala + maven + m2e

132 views
Skip to first unread message

Andrei Pozolotin

unread,
Feb 26, 2011, 9:32:16 PM2/26/11
to Scala IDE User
Hello;

can someone please recommend if there is a tutorial somehwere, which
shows how properly setup a project in eclipse, with mixed java+scala
code, and with m2e plugin;

the final result is a project which produces 3 consistent builds,
with maven artifact resolutions for both java and scala artifacts,
and includes scala-library.jar as maven dependency:

1) interactive JDT build in eclipse with M2E builder; (on code save)

2) batch M2E build in eclipse; (run as -> maven build)

3) batch maven build from command line; (mvn package)

thank you;

Andrei.

David Bernard

unread,
Feb 27, 2011, 3:40:07 AM2/27/11
to scala-i...@googlegroups.com, Andrei Pozolotin
Hi,

I'm not aware of any tutorial, but you can take a lot at

and to the sample projects liked.

I also suggest you to disable Maven Builder if you have trouble or if save action take too long.

If you find a tutorial can you link it in the wiki page.

Thanks

/davidB

Roland Kuhn

unread,
Feb 27, 2011, 11:51:49 AM2/27/11
to scala-i...@googlegroups.com
DISCLAIMER: this is just my very personal experience

- disabling the Maven Builder is not always feasible (e.g. code generated by Maven plugin)
- a disabled Maven Builder may lead to creation of a second (active) Maven Builder, I suppose done by m2e
- the project I'm currently working on does not build with Scala Builder, but works fine with "mvn test" from the command line, YMMV (it did work until very recently, and the bug I found is currently being fixed)
- apart from that Eclipse is the most powerful Scala IDE I know (esp. concerning type checking/info); I have just switched temporarily to IDEA which is not quite as good (more errors found only during compilation run)

Who of the core developers actually uses the OP's combination of tools? I ask, because it is a quite common setup in commercial development and thus should be supported well ...

Regards,

Roland

Andrei Pozolotin

unread,
Mar 17, 2011, 3:43:00 PM3/17/11
to Scala IDE User
FYI:

I found this helpful:
http://scala-tools.org/mvnsites/maven-scala-plugin/example_java.html

On Feb 26, 9:32 pm, Andrei Pozolotin <andrei.pozolo...@gmail.com>
wrote:
> Hello;
>
> can someone please recommend if there is a tutorial somehwere, which
> shows how properly setup a project in eclipse, with mixed java+scala
> code, and with m2e plugin;
>
> the final result is a project which produces 3 consistent builds,
> withmavenartifact resolutions for both java and scala artifacts,
> and includes scala-library.jar asmavendependency:
>
> 1) interactive JDT build in eclipse with M2E builder; (on code save)
>
> 2) batch M2E build in eclipse; (run as ->mavenbuild)
>
> 3) batchmavenbuild from command line; (mvn package)
>
> thank you;
>
> Andrei.
Reply all
Reply to author
Forward
0 new messages