m2eclipse-scala…

100 views
Skip to first unread message

Viktor Hedefalk

unread,
Oct 26, 2012, 9:42:22 AM10/26/12
to scala-i...@googlegroups.com
Hi,

I'm trying again to fix up a mixed scala/java maven project this time
using m2eclipse-scala.

I tried before without m2eclipse-scala and then I had big problems
with circular dependencies between Scala and Java. Either the Scala
source was red because it was missing the Java-classes or the
opposite. Builds fine with maven.

Since there is an example project under
https://github.com/sonatype/m2eclipse-scala with circular deps I
thought I should give it another try. I got the examples working using
latest scala-ide and m2e and also a small toy project. However, the
project at hand doesn't seem to trig m2eclipse-scala to do it's thing.

So my questions are:

1) What makes m2eclipse-scala realize a maven project is a Scala
project when doing "Import existing maven project"? For the sample and
toy project, Scala nature is added automatically and I notice that the
scala-library from MAVEN_DEPS is removed. But in my real project scala
nature isn't added automatically and when I do it manually I get two
scala-library.jar in my classpath (can this be why I had troubles
before?). I would really like to know what m2eclipse-scala does and
how I can make it do it OR how to do it manually myself if the
detection fails at import of the project…


2) Is there a way to trigger m2eclipse-scala to do it's thing AFTER an
import? Where is this configuration made? I see nothing in .classpath,
.project or any of the easy things that differs? I realize I need to
ask this rather basic too:

Is the plugin a live thing that hooks up in the build continuously or
is it just modifying some settings at import?




Thanks,
Viktor

David Bernard

unread,
Oct 26, 2012, 10:14:17 AM10/26/12
to scala-i...@googlegroups.com
Hi,

Project are detected as scala + maven:
* when m2e run "configuration update" (on import maven project, on explicit call right click on project (or .pom))
* if the project is detected as maven nature (via import as maven project)
* if maven-scala-plugin or scala-maven-plugin is listed in maven plugins used by the pom and not ignore

Can you tried to import the project as maven project after you remove .classes and .project files ?
Can you share the pom of your project ?

/davidB

Viktor Hedefalk

unread,
Oct 29, 2012, 9:01:27 AM10/29/12
to scala-i...@googlegroups.com
> Project are detected as scala + maven:
> * when m2e run "configuration update" (on import maven project, on explicit
> call right click on project (or .pom))
> * if the project is detected as maven nature (via import as maven project)
> * if maven-scala-plugin or scala-maven-plugin is listed in maven plugins
> used by the pom and not ignore

I have used "import existing maven project" and it IS detected as
maven and gets maven nature, but does not get scala nature.

> Can you tried to import the project as maven project after you remove
> .classes and .project files ?

I did
> rm -r .cache .classpath .project .settings
between each try to only have pom.xml and src folder


> Can you share the pom of your project ?

It's full of stuff I'm not too sure I can share publicly, but I'll
send it to you privately if that's ok.

Thanks a lot!

/Viktor
Reply all
Reply to author
Forward
0 new messages