[scala-tools] m2eclipse multi module

View: New views
13 Messages — Rating Filter:   Alert me  

Parent Message unknown [scala-tools] m2eclipse multi module

by tim tim-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

I have a problem with multi module scala projects in eclipse.

The project consists of a main project with a submodule with scala
code (there is no java code in the scala submodule).
I created the scala project from the scala-archetype-simple and
changed the scala version. The whole project is attached.

Most things work fine.
The problem is that errors and warnings are only shown in the main
project and not the scala submodule / project. I attached a picture of my
eclipse workspace - you can see: the red error markers are only
added to the project explorer view of the main project.

If I double click an error in the Problems-View the file is opened in
the context of the main project which of course has no scala nature
and the source is not syntax highlightened and not always up to date
with the view of the same file in the context of the scala sub
project.

Is there any configuration I could put into my pom or which i could
set in eclipse so that the errors appear where they really are?

I did not find a bug in the Scala trac that seems to relate to my problem.

My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
maven 2.0.9, sun java 1.6.0_16-b01

Does anyone use multi module maven projects with scala and m2eclipse?
I can not put all source files into one big project as I am working
with a Java project that is already split into multiple modules. But I
would love to implement new modules using Scala.

Using the eclipse maven plugin for creating the eclipse projects is
unfortunately also not an option as multiple developers are working
with the codebase and I can not make them all abandon the m2eclipse
plugin.


Thanks, Tim



scalaEclipseMavenMultiProject.png (147K) Download Attachment
eclipseScalaMaven.zip (5K) Download Attachment

Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Did you use the context menu "Scala -> add Scala Nature" on the scala  
project?

I believe what you're seeing is errors from m2e running the maven build.

When I have a real computer, I'll look at your project.

Sent from my iPhone

On Sep 14, 2009, at 10:48 PM, tim tim  
<timbaermannextra@...> wrote:

> Hello
>
> I have a problem with multi module scala projects in eclipse.
>
> The project consists of a main project with a submodule with scala
> code (there is no java code in the scala submodule).
> I created the scala project from the scala-archetype-simple and
> changed the scala version. The whole project is attached.
>
> Most things work fine.
> The problem is that errors and warnings are only shown in the main
> project and not the scala submodule / project. I attached a picture  
> of my
> eclipse workspace - you can see: the red error markers are only
> added to the project explorer view of the main project.
>
> If I double click an error in the Problems-View the file is opened in
> the context of the main project which of course has no scala nature
> and the source is not syntax highlightened and not always up to date
> with the view of the same file in the context of the scala sub
> project.
>
> Is there any configuration I could put into my pom or which i could
> set in eclipse so that the errors appear where they really are?
>
> I did not find a bug in the Scala trac that seems to relate to my  
> problem.
>
> My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
> Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
> maven 2.0.9, sun java 1.6.0_16-b01
>
> Does anyone use multi module maven projects with scala and m2eclipse?
> I can not put all source files into one big project as I am working
> with a Java project that is already split into multiple modules. But I
> would love to implement new modules using Scala.
>
> Using the eclipse maven plugin for creating the eclipse projects is
> unfortunately also not an option as multiple developers are working
> with the codebase and I can not make them all abandon the m2eclipse
> plugin.
>
>
> Thanks, Tim
> <scalaEclipseMavenMultiProject.png>
> <eclipseScalaMaven.zip>

Parent Message unknown Re: [scala-tools] m2eclipse multi module

by tim tim-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Josh

after your reply I tried it again, and cleaned the project directory
of all eclipse artifacts, so that only the pom.xml and the source code
were left.

Then I imported the project again into eclipse via import maven project.

The scala nature was added automatically by m2eclipse.

I never run the eclipse:eclipse target.

Thanks again for your help!

Best, Tim

On Tue, Sep 15, 2009 at 10:57 PM, Josh Suereth <joshua.suereth@...> wrote:

> m2eclipse did not used to add a scala nature.  If it does now, I'd be
> curious what else it is doing... (did you use mvn eclipse:eclpse...? please
> say 'no')
>
> I can't be more help as I use IAM at work, but I'll try to look into it when
> I'm at home.
>
> On Tue, Sep 15, 2009 at 10:24 AM, tim tim <timbaermannextra@...>
> wrote:
>>
>> hi joshua,
>>
>> thanks for your help.
>> Yes the project has the Scala Nature. That was done by m2eclipse.
>>
>> Probably I didn't make myself clear:
>>
>> The code has errors.
>>
>> Its just that these errors are not shown correctly in the Problems
>> View and in the Package Explorer.
>>
>> Best, tim
>>
>> On Tue, Sep 15, 2009 at 7:34 PM, Josh Suereth <joshua.suereth@...>
>> wrote:
>> > Did you use the context menu "Scala -> add Scala Nature" on the scala
>> > project?
>> >
>> > I believe what you're seeing is errors from m2e running the maven build.
>> >
>> > When I have a real computer, I'll look at your project.
>> >
>> > Sent from my iPhone
>> >
>> > On Sep 14, 2009, at 10:48 PM, tim tim <timbaermannextra@...>
>> > wrote:
>> >
>> >> Hello
>> >>
>> >> I have a problem with multi module scala projects in eclipse.
>> >>
>> >> The project consists of a main project with a submodule with scala
>> >> code (there is no java code in the scala submodule).
>> >> I created the scala project from the scala-archetype-simple and
>> >> changed the scala version. The whole project is attached.
>> >>
>> >> Most things work fine.
>> >> The problem is that errors and warnings are only shown in the main
>> >> project and not the scala submodule / project. I attached a picture of
>> >> my
>> >> eclipse workspace - you can see: the red error markers are only
>> >> added to the project explorer view of the main project.
>> >>
>> >> If I double click an error in the Problems-View the file is opened in
>> >> the context of the main project which of course has no scala nature
>> >> and the source is not syntax highlightened and not always up to date
>> >> with the view of the same file in the context of the scala sub
>> >> project.
>> >>
>> >> Is there any configuration I could put into my pom or which i could
>> >> set in eclipse so that the errors appear where they really are?
>> >>
>> >> I did not find a bug in the Scala trac that seems to relate to my
>> >> problem.
>> >>
>> >> My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
>> >> Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
>> >> maven 2.0.9, sun java 1.6.0_16-b01
>> >>
>> >> Does anyone use multi module maven projects with scala and m2eclipse?
>> >> I can not put all source files into one big project as I am working
>> >> with a Java project that is already split into multiple modules. But I
>> >> would love to implement new modules using Scala.
>> >>
>> >> Using the eclipse maven plugin for creating the eclipse projects is
>> >> unfortunately also not an option as multiple developers are working
>> >> with the codebase and I can not make them all abandon the m2eclipse
>> >> plugin.
>> >>
>> >>
>> >> Thanks, Tim
>> >> <scalaEclipseMavenMultiProject.png>
>> >> <eclipseScalaMaven.zip>
>> >
>
>

Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

can you check the builders on the project? Also is the eclipse scala plugin verison the same as the maven project's scala version?

On Tue, Sep 15, 2009 at 11:56 PM, tim tim <timbaermannextra@...> wrote:
Hi Josh

after your reply I tried it again, and cleaned the project directory
of all eclipse artifacts, so that only the pom.xml and the source code
were left.

Then I imported the project again into eclipse via import maven project.

The scala nature was added automatically by m2eclipse.

I never run the eclipse:eclipse target.

Thanks again for your help!

Best, Tim

On Tue, Sep 15, 2009 at 10:57 PM, Josh Suereth <joshua.suereth@...> wrote:
> m2eclipse did not used to add a scala nature.  If it does now, I'd be
> curious what else it is doing... (did you use mvn eclipse:eclpse...? please
> say 'no')
>
> I can't be more help as I use IAM at work, but I'll try to look into it when
> I'm at home.
>
> On Tue, Sep 15, 2009 at 10:24 AM, tim tim <timbaermannextra@...>
> wrote:
>>
>> hi joshua,
>>
>> thanks for your help.
>> Yes the project has the Scala Nature. That was done by m2eclipse.
>>
>> Probably I didn't make myself clear:
>>
>> The code has errors.
>>
>> Its just that these errors are not shown correctly in the Problems
>> View and in the Package Explorer.
>>
>> Best, tim
>>
>> On Tue, Sep 15, 2009 at 7:34 PM, Josh Suereth <joshua.suereth@...>
>> wrote:
>> > Did you use the context menu "Scala -> add Scala Nature" on the scala
>> > project?
>> >
>> > I believe what you're seeing is errors from m2e running the maven build.
>> >
>> > When I have a real computer, I'll look at your project.
>> >
>> > Sent from my iPhone
>> >
>> > On Sep 14, 2009, at 10:48 PM, tim tim <timbaermannextra@...>
>> > wrote:
>> >
>> >> Hello
>> >>
>> >> I have a problem with multi module scala projects in eclipse.
>> >>
>> >> The project consists of a main project with a submodule with scala
>> >> code (there is no java code in the scala submodule).
>> >> I created the scala project from the scala-archetype-simple and
>> >> changed the scala version. The whole project is attached.
>> >>
>> >> Most things work fine.
>> >> The problem is that errors and warnings are only shown in the main
>> >> project and not the scala submodule / project. I attached a picture of
>> >> my
>> >> eclipse workspace - you can see: the red error markers are only
>> >> added to the project explorer view of the main project.
>> >>
>> >> If I double click an error in the Problems-View the file is opened in
>> >> the context of the main project which of course has no scala nature
>> >> and the source is not syntax highlightened and not always up to date
>> >> with the view of the same file in the context of the scala sub
>> >> project.
>> >>
>> >> Is there any configuration I could put into my pom or which i could
>> >> set in eclipse so that the errors appear where they really are?
>> >>
>> >> I did not find a bug in the Scala trac that seems to relate to my
>> >> problem.
>> >>
>> >> My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
>> >> Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
>> >> maven 2.0.9, sun java 1.6.0_16-b01
>> >>
>> >> Does anyone use multi module maven projects with scala and m2eclipse?
>> >> I can not put all source files into one big project as I am working
>> >> with a Java project that is already split into multiple modules. But I
>> >> would love to implement new modules using Scala.
>> >>
>> >> Using the eclipse maven plugin for creating the eclipse projects is
>> >> unfortunately also not an option as multiple developers are working
>> >> with the codebase and I can not make them all abandon the m2eclipse
>> >> plugin.
>> >>
>> >>
>> >> Thanks, Tim
>> >> <scalaEclipseMavenMultiProject.png>
>> >> <eclipseScalaMaven.zip>
>> >
>
>


Re: [scala-tools] m2eclipse multi module

by tim tim-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the scala plugin and the maven projects scala version are both 2.7.6

the .project file of the scala projct (not the main project), as it
was created by m2eclipse, contains the following entries:
                ch.epfl.lamp.sdt.core.scalabuilder
                org.maven.ide.eclipse.maven2Builder

and the natures
                <nature>org.maven.ide.eclipse.maven2Nature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>ch.epfl.lamp.sdt.core.scalanature</nature>

the main project which does not contain any sources has only a
                org.eclipse.jdt.core.javabuilder

and the natures
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.maven.ide.eclipse.maven2Nature</nature>

best, tim

On Wed, Sep 16, 2009 at 7:57 PM, Josh Suereth <joshua.suereth@...> wrote:

> can you check the builders on the project? Also is the eclipse scala plugin
> verison the same as the maven project's scala version?
>
> On Tue, Sep 15, 2009 at 11:56 PM, tim tim <timbaermannextra@...>
> wrote:
>>
>> Hi Josh
>>
>> after your reply I tried it again, and cleaned the project directory
>> of all eclipse artifacts, so that only the pom.xml and the source code
>> were left.
>>
>> Then I imported the project again into eclipse via import maven project.
>>
>> The scala nature was added automatically by m2eclipse.
>>
>> I never run the eclipse:eclipse target.
>>
>> Thanks again for your help!
>>
>> Best, Tim
>>
>> On Tue, Sep 15, 2009 at 10:57 PM, Josh Suereth <joshua.suereth@...>
>> wrote:
>> > m2eclipse did not used to add a scala nature.  If it does now, I'd be
>> > curious what else it is doing... (did you use mvn eclipse:eclpse...?
>> > please
>> > say 'no')
>> >
>> > I can't be more help as I use IAM at work, but I'll try to look into it
>> > when
>> > I'm at home.
>> >
>> > On Tue, Sep 15, 2009 at 10:24 AM, tim tim
>> > <timbaermannextra@...>
>> > wrote:
>> >>
>> >> hi joshua,
>> >>
>> >> thanks for your help.
>> >> Yes the project has the Scala Nature. That was done by m2eclipse.
>> >>
>> >> Probably I didn't make myself clear:
>> >>
>> >> The code has errors.
>> >>
>> >> Its just that these errors are not shown correctly in the Problems
>> >> View and in the Package Explorer.
>> >>
>> >> Best, tim
>> >>
>> >> On Tue, Sep 15, 2009 at 7:34 PM, Josh Suereth
>> >> <joshua.suereth@...>
>> >> wrote:
>> >> > Did you use the context menu "Scala -> add Scala Nature" on the scala
>> >> > project?
>> >> >
>> >> > I believe what you're seeing is errors from m2e running the maven
>> >> > build.
>> >> >
>> >> > When I have a real computer, I'll look at your project.
>> >> >
>> >> > Sent from my iPhone
>> >> >
>> >> > On Sep 14, 2009, at 10:48 PM, tim tim
>> >> > <timbaermannextra@...>
>> >> > wrote:
>> >> >
>> >> >> Hello
>> >> >>
>> >> >> I have a problem with multi module scala projects in eclipse.
>> >> >>
>> >> >> The project consists of a main project with a submodule with scala
>> >> >> code (there is no java code in the scala submodule).
>> >> >> I created the scala project from the scala-archetype-simple and
>> >> >> changed the scala version. The whole project is attached.
>> >> >>
>> >> >> Most things work fine.
>> >> >> The problem is that errors and warnings are only shown in the main
>> >> >> project and not the scala submodule / project. I attached a picture
>> >> >> of
>> >> >> my
>> >> >> eclipse workspace - you can see: the red error markers are only
>> >> >> added to the project explorer view of the main project.
>> >> >>
>> >> >> If I double click an error in the Problems-View the file is opened
>> >> >> in
>> >> >> the context of the main project which of course has no scala nature
>> >> >> and the source is not syntax highlightened and not always up to date
>> >> >> with the view of the same file in the context of the scala sub
>> >> >> project.
>> >> >>
>> >> >> Is there any configuration I could put into my pom or which i could
>> >> >> set in eclipse so that the errors appear where they really are?
>> >> >>
>> >> >> I did not find a bug in the Scala trac that seems to relate to my
>> >> >> problem.
>> >> >>
>> >> >> My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
>> >> >> Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
>> >> >> maven 2.0.9, sun java 1.6.0_16-b01
>> >> >>
>> >> >> Does anyone use multi module maven projects with scala and
>> >> >> m2eclipse?
>> >> >> I can not put all source files into one big project as I am working
>> >> >> with a Java project that is already split into multiple modules. But
>> >> >> I
>> >> >> would love to implement new modules using Scala.
>> >> >>
>> >> >> Using the eclipse maven plugin for creating the eclipse projects is
>> >> >> unfortunately also not an option as multiple developers are working
>> >> >> with the codebase and I can not make them all abandon the m2eclipse
>> >> >> plugin.
>> >> >>
>> >> >>
>> >> >> Thanks, Tim
>> >> >> <scalaEclipseMavenMultiProject.png>
>> >> >> <eclipseScalaMaven.zip>
>> >> >
>> >
>> >
>
>

Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interesting.  I'll have to look at maven2Builder from m2e.  It could be reporting/assigning errors strangely.  What happens if you close the parent project?

Also, you should *not* use 2.7.6 due to a bug in scalac.  Try 2.7.5.

- Josh

On Wed, Sep 16, 2009 at 8:22 AM, tim tim <timbaermannextra@...> wrote:
the scala plugin and the maven projects scala version are both 2.7.6

the .project file of the scala projct (not the main project), as it
was created by m2eclipse, contains the following entries:
               ch.epfl.lamp.sdt.core.scalabuilder
               org.maven.ide.eclipse.maven2Builder

and the natures
               <nature>org.maven.ide.eclipse.maven2Nature</nature>
               <nature>org.eclipse.jdt.core.javanature</nature>
               <nature>ch.epfl.lamp.sdt.core.scalanature</nature>

the main project which does not contain any sources has only a
               org.eclipse.jdt.core.javabuilder

and the natures
               <nature>org.eclipse.jdt.core.javanature</nature>
               <nature>org.maven.ide.eclipse.maven2Nature</nature>

best, tim

On Wed, Sep 16, 2009 at 7:57 PM, Josh Suereth <joshua.suereth@...> wrote:
> can you check the builders on the project? Also is the eclipse scala plugin
> verison the same as the maven project's scala version?
>
> On Tue, Sep 15, 2009 at 11:56 PM, tim tim <timbaermannextra@...>
> wrote:
>>
>> Hi Josh
>>
>> after your reply I tried it again, and cleaned the project directory
>> of all eclipse artifacts, so that only the pom.xml and the source code
>> were left.
>>
>> Then I imported the project again into eclipse via import maven project.
>>
>> The scala nature was added automatically by m2eclipse.
>>
>> I never run the eclipse:eclipse target.
>>
>> Thanks again for your help!
>>
>> Best, Tim
>>
>> On Tue, Sep 15, 2009 at 10:57 PM, Josh Suereth <joshua.suereth@...>
>> wrote:
>> > m2eclipse did not used to add a scala nature.  If it does now, I'd be
>> > curious what else it is doing... (did you use mvn eclipse:eclpse...?
>> > please
>> > say 'no')
>> >
>> > I can't be more help as I use IAM at work, but I'll try to look into it
>> > when
>> > I'm at home.
>> >
>> > On Tue, Sep 15, 2009 at 10:24 AM, tim tim
>> > <timbaermannextra@...>
>> > wrote:
>> >>
>> >> hi joshua,
>> >>
>> >> thanks for your help.
>> >> Yes the project has the Scala Nature. That was done by m2eclipse.
>> >>
>> >> Probably I didn't make myself clear:
>> >>
>> >> The code has errors.
>> >>
>> >> Its just that these errors are not shown correctly in the Problems
>> >> View and in the Package Explorer.
>> >>
>> >> Best, tim
>> >>
>> >> On Tue, Sep 15, 2009 at 7:34 PM, Josh Suereth
>> >> <joshua.suereth@...>
>> >> wrote:
>> >> > Did you use the context menu "Scala -> add Scala Nature" on the scala
>> >> > project?
>> >> >
>> >> > I believe what you're seeing is errors from m2e running the maven
>> >> > build.
>> >> >
>> >> > When I have a real computer, I'll look at your project.
>> >> >
>> >> > Sent from my iPhone
>> >> >
>> >> > On Sep 14, 2009, at 10:48 PM, tim tim
>> >> > <timbaermannextra@...>
>> >> > wrote:
>> >> >
>> >> >> Hello
>> >> >>
>> >> >> I have a problem with multi module scala projects in eclipse.
>> >> >>
>> >> >> The project consists of a main project with a submodule with scala
>> >> >> code (there is no java code in the scala submodule).
>> >> >> I created the scala project from the scala-archetype-simple and
>> >> >> changed the scala version. The whole project is attached.
>> >> >>
>> >> >> Most things work fine.
>> >> >> The problem is that errors and warnings are only shown in the main
>> >> >> project and not the scala submodule / project. I attached a picture
>> >> >> of
>> >> >> my
>> >> >> eclipse workspace - you can see: the red error markers are only
>> >> >> added to the project explorer view of the main project.
>> >> >>
>> >> >> If I double click an error in the Problems-View the file is opened
>> >> >> in
>> >> >> the context of the main project which of course has no scala nature
>> >> >> and the source is not syntax highlightened and not always up to date
>> >> >> with the view of the same file in the context of the scala sub
>> >> >> project.
>> >> >>
>> >> >> Is there any configuration I could put into my pom or which i could
>> >> >> set in eclipse so that the errors appear where they really are?
>> >> >>
>> >> >> I did not find a bug in the Scala trac that seems to relate to my
>> >> >> problem.
>> >> >>
>> >> >> My configuration is Ubuntu 9.4 64bit, Eclipse 3.5, Scala IDE for
>> >> >> Eclipse 2.7.6-final, m2eclipse 0.9.200905041414,
>> >> >> maven 2.0.9, sun java 1.6.0_16-b01
>> >> >>
>> >> >> Does anyone use multi module maven projects with scala and
>> >> >> m2eclipse?
>> >> >> I can not put all source files into one big project as I am working
>> >> >> with a Java project that is already split into multiple modules. But
>> >> >> I
>> >> >> would love to implement new modules using Scala.
>> >> >>
>> >> >> Using the eclipse maven plugin for creating the eclipse projects is
>> >> >> unfortunately also not an option as multiple developers are working
>> >> >> with the codebase and I can not make them all abandon the m2eclipse
>> >> >> plugin.
>> >> >>
>> >> >>
>> >> >> Thanks, Tim
>> >> >> <scalaEclipseMavenMultiProject.png>
>> >> >> <eclipseScalaMaven.zip>
>> >> >
>> >
>> >
>
>


Re: [scala-tools] m2eclipse multi module

by Miles Sabin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 14, 2009 at 7:48 PM, tim tim
<timbaermannextra@...> wrote:
> The problem is that errors and warnings are only shown in the main
> project and not the scala submodule / project. I attached a picture of my
> eclipse workspace - you can see: the red error markers are only
> added to the project explorer view of the main project.

From that screenshot it looks like you have two Eclipse projects
nested one inside the other ... I'd be surprised if that worked
correctly whether or not Scala was involved.

I suggest rearranging things so that you have two non-nested top-level
project and get back to me if that doesn't solve the problem.

Cheers,


Miles

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

Re: [scala-tools] m2eclipse multi module

by tim tim-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Miles,

> From that screenshot it looks like you have two Eclipse projects
> nested one inside the other ...

yes that is true,
one project is part of an other one.
But that is a typical maven setup and it works fine with java projects.

> I'd be surprised if that worked
> correctly whether or not Scala was involved.

I added a java project parallel to the scala project. Both are
submodules of the main module. The java project works as expected, the
scala project does not.

@Josh:
And closing the main project does not help either.

I attached a screenshot that shows the problem.

If I make the scala project a top level maven project and not a
submodule of a bigger project, as you suggest, everything works fine.

But that is exactly the problem that I have: I would like the scala
module to be part of a bigger java project which gets build via
maven2.
The maven2 build part works fine with the setup as I have it now. But
then eclipse does not work as expected. And if I make the scala
project a top level maven project eclipse works fine, but the maven2
build does not...

Thanks again for your kind help,

Tim


On Wed, Sep 16, 2009 at 9:38 PM, Miles Sabin <miles@...> wrote:

> On Mon, Sep 14, 2009 at 7:48 PM, tim tim
> <timbaermannextra@...> wrote:
>> The problem is that errors and warnings are only shown in the main
>> project and not the scala submodule / project. I attached a picture of my
>> eclipse workspace - you can see: the red error markers are only
>> added to the project explorer view of the main project.
>
> From that screenshot it looks like you have two Eclipse projects
> nested one inside the other ... I'd be surprised if that worked
> correctly whether or not Scala was involved.
>
> I suggest rearranging things so that you have two non-nested top-level
> project and get back to me if that doesn't solve the problem.
>
> Cheers,
>
>
> Miles
>
> --
> Miles Sabin
> tel: +44 (0)7813 944 528
> skype:  milessabin
> http://www.chuusai.com/
> http://twitter.com/milessabin
>


m2eclipseMultiModuleMainClosed.png (155K) Download Attachment

Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I highly doubt the nested projects is the problem as I use this style setup everyday at work.  It's also how both maven plugins do eclipse integration. 

I'm wondering if m2e is doing something strange.  Like I said, I have not used m2e for a long time.

- Josh

On Wed, Sep 16, 2009 at 9:38 AM, Miles Sabin <miles@...> wrote:
On Mon, Sep 14, 2009 at 7:48 PM, tim tim
<timbaermannextra@...> wrote:
> The problem is that errors and warnings are only shown in the main
> project and not the scala submodule / project. I attached a picture of my
> eclipse workspace - you can see: the red error markers are only
> added to the project explorer view of the main project.

From that screenshot it looks like you have two Eclipse projects
nested one inside the other ... I'd be surprised if that worked
correctly whether or not Scala was involved.

I suggest rearranging things so that you have two non-nested top-level
project and get back to me if that doesn't solve the problem.

Cheers,


Miles

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


Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try disabling the maven builder, so only the scala builder runs.  I'm curious if there's some conflicts between the two.  I'm going to start monitor the m2e lists to see if I can figure out what/how they're doing integration.

- Josh

On Wed, Sep 16, 2009 at 11:28 AM, tim tim <timbaermannextra@...> wrote:
Thanks Miles,

> From that screenshot it looks like you have two Eclipse projects
> nested one inside the other ...

yes that is true,
one project is part of an other one.
But that is a typical maven setup and it works fine with java projects.

> I'd be surprised if that worked
> correctly whether or not Scala was involved.

I added a java project parallel to the scala project. Both are
submodules of the main module. The java project works as expected, the
scala project does not.

@Josh:
And closing the main project does not help either.

I attached a screenshot that shows the problem.

If I make the scala project a top level maven project and not a
submodule of a bigger project, as you suggest, everything works fine.

But that is exactly the problem that I have: I would like the scala
module to be part of a bigger java project which gets build via
maven2.
The maven2 build part works fine with the setup as I have it now. But
then eclipse does not work as expected. And if I make the scala
project a top level maven project eclipse works fine, but the maven2
build does not...

Thanks again for your kind help,

Tim


On Wed, Sep 16, 2009 at 9:38 PM, Miles Sabin <miles@...> wrote:
> On Mon, Sep 14, 2009 at 7:48 PM, tim tim
> <timbaermannextra@...> wrote:
>> The problem is that errors and warnings are only shown in the main
>> project and not the scala submodule / project. I attached a picture of my
>> eclipse workspace - you can see: the red error markers are only
>> added to the project explorer view of the main project.
>
> From that screenshot it looks like you have two Eclipse projects
> nested one inside the other ... I'd be surprised if that worked
> correctly whether or not Scala was involved.
>
> I suggest rearranging things so that you have two non-nested top-level
> project and get back to me if that doesn't solve the problem.
>
> Cheers,
>
>
> Miles
>
> --
> Miles Sabin
> tel: +44 (0)7813 944 528
> skype:  milessabin
> http://www.chuusai.com/
> http://twitter.com/milessabin
>


Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh, can I also see your pom?

On Wed, Sep 16, 2009 at 11:47 AM, Josh Suereth <joshua.suereth@...> wrote:
I highly doubt the nested projects is the problem as I use this style setup everyday at work.  It's also how both maven plugins do eclipse integration. 

I'm wondering if m2e is doing something strange.  Like I said, I have not used m2e for a long time.

- Josh

On Wed, Sep 16, 2009 at 9:38 AM, Miles Sabin <miles@...> wrote:
On Mon, Sep 14, 2009 at 7:48 PM, tim tim
<timbaermannextra@...> wrote:
> The problem is that errors and warnings are only shown in the main
> project and not the scala submodule / project. I attached a picture of my
> eclipse workspace - you can see: the red error markers are only
> added to the project explorer view of the main project.

From that screenshot it looks like you have two Eclipse projects
nested one inside the other ... I'd be surprised if that worked
correctly whether or not Scala was involved.

I suggest rearranging things so that you have two non-nested top-level
project and get back to me if that doesn't solve the problem.

Cheers,


Miles

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



Re: [scala-tools] m2eclipse multi module

by tim tim-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Disabling the m2e builder in eclipse did not help.

my poms are :

for the main project:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>testGroup</groupId>
  <artifactId>mainProj</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>mainProj</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <modules>
    <module>scalaModule</module>
    <module>javaProj</module>
  </modules>
</project>

and for the scala project :

<?xml version="1.0"?><project>
  <parent>
    <artifactId>mainProj</artifactId>
    <groupId>testGroup</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>testGrp</groupId>
  <artifactId>scalaModule</artifactId>
  <version>1.0-SNAPSHOT</version>

 <build>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <testSourceDirectory>src/test/scala</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <args>
            <arg>-target:jvm-1.5</arg>
          </args>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <downloadSources>true</downloadSources>
          <buildcommands>
            <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
          </buildcommands>
          <additionalProjectnatures>
            <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
          </additionalProjectnatures>
          <classpathContainers>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
            <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
          </classpathContainers>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>scala-tools.org</id>
      <name>Scala-Tools Maven2 Repository</name>
      <url>http://scala-tools.org/repo-releases</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>scala-tools.org</id>
      <name>Scala-Tools Maven2 Repository</name>
      <url>http://scala-tools.org/repo-releases</url>
    </pluginRepository>
  </pluginRepositories>
  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.specs</groupId>
      <artifactId>specs</artifactId>
      <version>1.2.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  <properties>
    <scala.version>2.7.6</scala.version>
  </properties>
</project>



best, tim


On Wed, Sep 16, 2009 at 11:49 PM, Josh Suereth <joshua.suereth@...> wrote:

> Oh, can I also see your pom?
>
> On Wed, Sep 16, 2009 at 11:47 AM, Josh Suereth <joshua.suereth@...>
> wrote:
>>
>> I highly doubt the nested projects is the problem as I use this style
>> setup everyday at work.  It's also how both maven plugins do eclipse
>> integration.
>>
>> I'm wondering if m2e is doing something strange.  Like I said, I have not
>> used m2e for a long time.
>>
>> - Josh
>>
>> On Wed, Sep 16, 2009 at 9:38 AM, Miles Sabin <miles@...> wrote:
>>>
>>> On Mon, Sep 14, 2009 at 7:48 PM, tim tim
>>> <timbaermannextra@...> wrote:
>>> > The problem is that errors and warnings are only shown in the main
>>> > project and not the scala submodule / project. I attached a picture of
>>> > my
>>> > eclipse workspace - you can see: the red error markers are only
>>> > added to the project explorer view of the main project.
>>>
>>> From that screenshot it looks like you have two Eclipse projects
>>> nested one inside the other ... I'd be surprised if that worked
>>> correctly whether or not Scala was involved.
>>>
>>> I suggest rearranging things so that you have two non-nested top-level
>>> project and get back to me if that doesn't solve the problem.
>>>
>>> Cheers,
>>>
>>>
>>> Miles
>>>
>>> --
>>> Miles Sabin
>>> tel: +44 (0)7813 944 528
>>> skype:  milessabin
>>> http://www.chuusai.com/
>>> http://twitter.com/milessabin
>>
>
>

Re: [scala-tools] m2eclipse multi module

by Josh Suereth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The maven-eclipse-plugin is what's setting up the scala nature.  m2eclipse makes special knowledge of this plugin and tries to set up the project appropriately.  See if Removing/Adding the Scala Nature helps.  I'm swamped for time at work.  I'll see if i can play through this and offer some help soon.

- Josh

On Thu, Sep 17, 2009 at 12:15 PM, tim tim <timbaermannextra@...> wrote:
Disabling the m2e builder in eclipse did not help.

my poms are :

for the main project:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>testGroup</groupId>
 <artifactId>mainProj</artifactId>
 <packaging>pom</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>mainProj</name>
 <url>http://maven.apache.org</url>
 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>
   </dependency>
 </dependencies>
 <modules>
   <module>scalaModule</module>
   <module>javaProj</module>
 </modules>
</project>

and for the scala project :

<?xml version="1.0"?><project>
 <parent>
   <artifactId>mainProj</artifactId>
   <groupId>testGroup</groupId>
   <version>1.0-SNAPSHOT</version>
 </parent>
 <modelVersion>4.0.0</modelVersion>
 <groupId>testGrp</groupId>
 <artifactId>scalaModule</artifactId>
 <version>1.0-SNAPSHOT</version>

 <build>
   <sourceDirectory>src/main/scala</sourceDirectory>
   <testSourceDirectory>src/test/scala</testSourceDirectory>
   <plugins>
     <plugin>
       <groupId>org.scala-tools</groupId>
       <artifactId>maven-scala-plugin</artifactId>
       <executions>
         <execution>
           <goals>
             <goal>compile</goal>
             <goal>testCompile</goal>
           </goals>
         </execution>
       </executions>
       <configuration>
         <scalaVersion>${scala.version}</scalaVersion>
         <args>
           <arg>-target:jvm-1.5</arg>
         </args>
       </configuration>
     </plugin>
     <plugin>
       <artifactId>maven-eclipse-plugin</artifactId>
       <configuration>
         <downloadSources>true</downloadSources>
         <buildcommands>
           <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
         </buildcommands>
         <additionalProjectnatures>
           <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
         </additionalProjectnatures>
         <classpathContainers>
           <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
           <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
         </classpathContainers>
       </configuration>
     </plugin>
   </plugins>
 </build>
 <repositories>
   <repository>
     <id>scala-tools.org</id>
     <name>Scala-Tools Maven2 Repository</name>
     <url>http://scala-tools.org/repo-releases</url>
   </repository>
 </repositories>
 <pluginRepositories>
   <pluginRepository>
     <id>scala-tools.org</id>
     <name>Scala-Tools Maven2 Repository</name>
     <url>http://scala-tools.org/repo-releases</url>
   </pluginRepository>
 </pluginRepositories>
 <dependencies>
   <dependency>
     <groupId>org.scala-lang</groupId>
     <artifactId>scala-library</artifactId>
     <version>${scala.version}</version>
   </dependency>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>4.4</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>org.specs</groupId>
     <artifactId>specs</artifactId>
     <version>1.2.5</version>
     <scope>test</scope>
   </dependency>
 </dependencies>
 <reporting>
   <plugins>
     <plugin>
       <groupId>org.scala-tools</groupId>
       <artifactId>maven-scala-plugin</artifactId>
       <configuration>
         <scalaVersion>${scala.version}</scalaVersion>
       </configuration>
     </plugin>
   </plugins>
 </reporting>
 <properties>
   <scala.version>2.7.6</scala.version>
 </properties>
</project>



best, tim


On Wed, Sep 16, 2009 at 11:49 PM, Josh Suereth <joshua.suereth@...> wrote:
> Oh, can I also see your pom?
>
> On Wed, Sep 16, 2009 at 11:47 AM, Josh Suereth <joshua.suereth@...>
> wrote:
>>
>> I highly doubt the nested projects is the problem as I use this style
>> setup everyday at work.  It's also how both maven plugins do eclipse
>> integration.
>>
>> I'm wondering if m2e is doing something strange.  Like I said, I have not
>> used m2e for a long time.
>>
>> - Josh
>>
>> On Wed, Sep 16, 2009 at 9:38 AM, Miles Sabin <miles@...> wrote:
>>>
>>> On Mon, Sep 14, 2009 at 7:48 PM, tim tim
>>> <timbaermannextra@...> wrote:
>>> > The problem is that errors and warnings are only shown in the main
>>> > project and not the scala submodule / project. I attached a picture of
>>> > my
>>> > eclipse workspace - you can see: the red error markers are only
>>> > added to the project explorer view of the main project.
>>>
>>> From that screenshot it looks like you have two Eclipse projects
>>> nested one inside the other ... I'd be surprised if that worked
>>> correctly whether or not Scala was involved.
>>>
>>> I suggest rearranging things so that you have two non-nested top-level
>>> project and get back to me if that doesn't solve the problem.
>>>
>>> Cheers,
>>>
>>>
>>> Miles
>>>
>>> --
>>> Miles Sabin
>>> tel: +44 (0)7813 944 528
>>> skype:  milessabin
>>> http://www.chuusai.com/
>>> http://twitter.com/milessabin
>>
>
>