some troubles with the ide

53 views
Skip to first unread message
Message has been deleted

Arun Ramakrishnan

unread,
May 23, 2012, 2:55:23 PM5/23/12
to scala-...@googlegroups.com
Guys,
   I had some trouble with the scala-ide for the past couple of days.

The project in reference is a maven module project. The only reason its part of a multi module project is that i like to manage my dependency versions in one place. It also has both Java and Scala source.

Please refer below for version and platform information.


Some of the trouble I am having.

1. There is this odd red block of color randomly appearing all over in my package explorer. see attached image below. This doesn't happen in my other projects.

2. The source refuses to compile on save once there has been any error in the project. All i get is some "main class not found" when i try to run a class from the ide. So, I am forced to resort to goto the command line and do "mvn compile" or  "mvn clean compile" every time i even change a couple of characters.

3. Once an error appears in the "Problems" window, it wont go away a lot of times, even if i do clean compile from the ide or the command line. I have to select the specific error and delete it explicitly hoping that it will go away.

4. Whenever I delete a source file or refactor it, I get an error saying cannot find find the source file.

5. This one is more of a best practice question. I read somewhere that maven dosent like mixing java and scala source in the same directory source path. Is this right ? I haven't had too much trouble mixing groovy and java in the same directory. You might notice that I have .java files in my src/main/scala path. I tried separating them out, but that didnt help.


Things I tried to do to fix these issues are
Try to reload project configuration, Delete .project and .classpath and recreate them again either via the ide or mvn eclipse plugin. Restart the ide etc



Thanks for the help.



#####################################################################

What versions am i using ?

I am using the latest STS 2.9.1 ( OS X 10.7 ) with the latest updates for m2e and scala-ide that i installed using the STS extensions feature.
Image2

In my pom i have configured both scala and mavan-scala-plugin to version 2.91.
Here is my plugin config.
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
            <groupId>org.scala-tools</groupId>
            <artifactId>maven-scala-plugin</artifactId>
            <executions>
                <execution>
                    <id>compile</id>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                    <phase>compile</phase>
                </execution>
                <execution>
                    <id>test-compile</id>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                    <phase>test-compile</phase>
                </execution>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

######################################################
Screen Shot 2012-05-23 at 11.49.27 AM.png
Screen Shot 2012-05-23 at 11.50.48 AM.png
Message has been deleted

David Bernard

unread,
May 23, 2012, 2:59:10 PM5/23/12
to scala-...@googlegroups.com

You should not mixe m2e and maven-eclipse-plugin: there are incompatible.

I suggest you :
* to use m2e-scala instead of maven-eclipse-plugin
* to use the goal <add-source> (see
http://davidb.github.com/scala-maven-plugin/example_java.html) if you
put .scala in an other directory than <sourceDirectory>
* to upgrade your maven-scala-plugin to scala-maven-plugin (optionnal)

I often use the same directory for .java and .scala (src/main/jvm)
without trouble, there is no best practive (IMO).

/davidB
>
>
>
> Thanks for the help.
>
> ###############################
>
> Image1


>
>
>
> #####################################################################
>
> What versions am i using ?
>
> I am using the latest STS 2.9.1 ( OS X 10.7 ) with the latest updates for
> m2e and scala-ide that i installed using the STS extensions feature.
>
>
>

Arun Ramakrishnan

unread,
May 23, 2012, 3:34:22 PM5/23/12
to scala-...@googlegroups.com
Thanks David. As dyslexic as I am I would probably not have noticed the difference between scala-maven-plugin and maven-scala-plugin.

I wasn't super clear about your suggestion.
I get that maven-scala-plugin should go away.

 Is scala-maven-plugin optional to m2e-scala OR is scala-maven-plugin optional besides m2e-scala ?

Also, how do i configure this m2e-scala. I found scala-maven-plugin on maven central. But, not m2e-scala.


thanks
Arun

Mirco Dotta

unread,
May 23, 2012, 3:46:02 PM5/23/12
to scala-...@googlegroups.com
Minor point, you should upgrade to V2.0.1 - http://scala-ide.org/download/current.html#201_release

-- Mirco

David Bernard

unread,
May 23, 2012, 4:03:01 PM5/23/12
to scala-...@googlegroups.com
On Wed, May 23, 2012 at 9:46 PM, Mirco Dotta <mirco...@typesafe.com> wrote:
> Minor point, you should upgrade to V2.0.1 -
> http://scala-ide.org/download/current.html#201_release
>
> -- Mirco
>
> On May 23, 2012, at 9:34 PM, Arun Ramakrishnan wrote:
>
> Thanks David. As dyslexic as I am I would probably not have noticed the
> difference between scala-maven-plugin and maven-scala-plugin.
>
> I wasn't super clear about your suggestion.
> I get that maven-scala-plugin should go away.
>
>  Is scala-maven-plugin optional to m2e-scala OR is scala-maven-plugin
> optional besides m2e-scala ?

scala-maven-plugin is to compile scala with maven (available on central)
m2e-scala is a dedicated connector for m2e. it detects maven project
as scala project if scala-maven-plugin or maven-scala-plugin
(deprecated) is used in the pom.

>
> Also, how do i configure this m2e-scala. I found scala-maven-plugin on maven
> central. But, not m2e-scala.

see https://github.com/sonatype/m2eclipse-scala (there is an update-site listed)

sin.bits

unread,
May 23, 2012, 6:23:32 PM5/23/12
to scala-...@googlegroups.com
After updating m2eclipse-scala, everything looks good. Looks like the update added m2e integration points for the scala-maven-plugin.

I cannot believe, I repeat cannot believe that I suffered through an incompatible plugin for 2 months. Anyway, happy coding now.

I do wish the naming changes were more obvious :-)

thanks David.

Arun

iulian dragos

unread,
May 24, 2012, 4:21:16 AM5/24/12
to scala-...@googlegroups.com
On Thu, May 24, 2012 at 12:23 AM, sin.bits <sinchron...@gmail.com> wrote:
> After updating m2eclipse-scala, everything looks good. Looks like the update
> added m2e integration points for the scala-maven-plugin.
>
> I cannot believe, I repeat cannot believe that I suffered through an
> incompatible plugin for 2 months. Anyway, happy coding now.
>
> I do wish the naming changes were more obvious :-)

Would you like to write up a little section in the docs? The 'Getting
Started' has an embryonic section on using Scala + Maven + Scala IDE,
but obviously this is not enough to get people started:

http://scala-ide.org/docs/user/gettingstarted.html

I think it's not too much work, and it would be great for other maven
users. The docs are managed through git, and they have their own
repository, so it shouldn't be too hard:

https://github.com/scala-ide/docs

cheers,
iulian
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

David Bernard

unread,
May 24, 2012, 3:16:17 PM5/24/12
to scala-...@googlegroups.com
Hi,

Yesterday I search for doc about maven in the site, and find nothing. Because :
* I only search by browsing Title of page/link (like it was in the wiki)
* there is no search form in the documentation (may be google on site widget)

The small text is enought and provide the minimal info, IMHO it should
have it's own page. I image there are more user interesting by maven
intergration than by ¨Play intergation. But I don't know where to put
the page. I'm fine to made pull request when done (it's the
oportunities to try sphynx).

/davidB

Mirco Dotta

unread,
May 26, 2012, 9:14:10 AM5/26/12
to scala-...@googlegroups.com
Hi David,


> Yesterday I search for doc about maven in the site, and find nothing. Because :
> * I only search by browsing Title of page/link (like it was in the wiki)
> * there is no search form in the documentation (may be google on site widget)

I agree, it would be nice to have a "google on site" widget, at least in the doc.
I created a ticket for it: https://github.com/scala-ide/scala-ide.github.com/issues/20

> The small text is enought and provide the minimal info, IMHO it should
> have it's own page. I image there are more user interesting by maven
> intergration than by ¨Play intergation. But I don't know where to put
> the page. I'm fine to made pull request when done (it's the
> oportunities to try sphynx).

Why not having it in the Tutorials section? https://github.com/scala-ide/docs/tree/master/tutorials
Or you think that's not visible enough?

Thanks a lot for volunteering for this task. You are right to say that more user are interested in
maven integration, so let's make sure that is easy to find the information once it is there.

-- Mirco

Arun Ramakrishnan

unread,
May 28, 2012, 5:27:24 PM5/28/12
to scala-...@googlegroups.com
I will also contribute my learnings on the suggested pages.
Reply all
Reply to author
Forward
0 new messages