- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Problem using Scala Eclipse Plugin with Wicket Maven Project
Thu, 2009-03-19, 10:35
Hello Miles,
thanks for your help. Like you said, I did a lot of manual edits to the project, which led to my problems. So I used the "Add Scala Nature" -action and now the problem is gone. Now I am facing the next problem. First my configuration: Eclipse 3.4.2, Windows XP, Scala Eclipse Plugin 2.7.3. final, project was initally set up with mvn eclipse:eclipse, I also added the scala-library and the maven-scala-plugin to my pom.xml.
I use several source folders in my project:
src/main/java/
src/main/resources/
src/test/java/
src/test/resources/
src/test/scala/
The Problem I am facing right now is that I want to use a Java Class from src/test/java/ but I can only reference classes from src/main/java. I already modified the output folder in the source tab of the java build path property page to point to the same folder. This also didn't help.
On Wed, Mar 18, 2009 at 7:21 PM, Miles Sabin <miles@milessabin.com> wrote:
thanks for your help. Like you said, I did a lot of manual edits to the project, which led to my problems. So I used the "Add Scala Nature" -action and now the problem is gone. Now I am facing the next problem. First my configuration: Eclipse 3.4.2, Windows XP, Scala Eclipse Plugin 2.7.3. final, project was initally set up with mvn eclipse:eclipse, I also added the scala-library and the maven-scala-plugin to my pom.xml.
I use several source folders in my project:
src/main/java/
src/main/resources/
src/test/java/
src/test/resources/
src/test/scala/
The Problem I am facing right now is that I want to use a Java Class from src/test/java/ but I can only reference classes from src/main/java. I already modified the output folder in the source tab of the java build path property page to point to the same folder. This also didn't help.
On Wed, Mar 18, 2009 at 7:21 PM, Miles Sabin <miles@milessabin.com> wrote:
On Wed, Mar 18, 2009 at 6:10 PM, Enes Fazli <fazli.enes@googlemail.com> wrote:
> I want to try Scala for the project I am working on right now. It is a
> wicket application using maven. So I installed the Scala Eclipse Plugin
Which Eclipse version? Plugin version? Platform?
> added the scala nature and build command to the .project file. I also added
> the scala library and the scala maven plugin to my pom.xml and created a
> separate folder for the scala sources. My problem is that when I create a
> Scala Class it seems that both Java and Scala tries to build it. That
> results in errors like a ; is needed for the package statement but on the
> other hand the public attribute is invalid.
It sounds like you've made all kinds of manual edits to your project
metadata. If you post the contents of your .classpath and .project
files I might be able to work out what's going on (at a minimum it
sounds like you've left the Java builder in your .project which is
incorrect if you're using 2.7.3.final).
As a general rule you should convert Java projects to Scala projects
by using the "Add Scala Nature" package explorer context menu action
unless you know what you're doing.
But you might also be having Maven-specific issues ... which maybe
Josh can help you out with.
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
Thu, 2009-03-19, 11:57
#2
Re: Problem using Scala Eclipse Plugin with Wicket Maven Projec
I'm currently running the nightly, and have gotten classes visible
from multi-source directories. I'm using q4e though.
Although i would rexommend upgrading your eclipse version to nightly
builds, I would only do so if you also plan to use the nightly build
in maven.
Sent from my iPhone
On Mar 19, 2009, at 5:56 AM, Miles Sabin wrote:
> On Thu, Mar 19, 2009 at 9:35 AM, Enes Fazli
> wrote:
>> I use several source folders in my project:
>
> Unfortunately only one source and one output directory is currently
> supported (as in, expected to work without difficulty).
>
> However, you might be in luck if you make sure that you have only one
> output folder for _all_ of your source folders.
>
> Cheers,
>
>
> Miles
>
Thu, 2009-03-19, 12:07
#3
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
Hello Miles,
your suggestion was correct. It works now and there is a last problem remaining. The Scala Files don't get build on project build but only if I save the file in the editor. So, I would need to manually open the scala files and save them every time I make a project clean.
Regards,
Enes
On Thu, Mar 19, 2009 at 10:56 AM, Miles Sabin <miles@milessabin.com> wrote:
your suggestion was correct. It works now and there is a last problem remaining. The Scala Files don't get build on project build but only if I save the file in the editor. So, I would need to manually open the scala files and save them every time I make a project clean.
Regards,
Enes
On Thu, Mar 19, 2009 at 10:56 AM, Miles Sabin <miles@milessabin.com> wrote:
On Thu, Mar 19, 2009 at 9:35 AM, Enes Fazli <fazli.enes@googlemail.com> wrote:
> I use several source folders in my project:
Unfortunately only one source and one output directory is currently
supported (as in, expected to work without difficulty).
However, you might be in luck if you make sure that you have only one
output folder for _all_ of your source folders.
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
Thu, 2009-03-19, 13:07
#4
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
On Thu, Mar 19, 2009 at 11:01 AM, Enes Fazli wrote:
> your suggestion was correct. It works now and there is a last problem
> remaining. The Scala Files don't get build on project build but only if I
> save the file in the editor. So, I would need to manually open the scala
> files and save them every time I make a project clean.
Hmm ... do you have a .setting directory at the top-level of your
project? What's in it?
Cheers,
Miles
Thu, 2009-03-19, 13:17
#5
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
I have a .settings directory but there is only a .settings directory in it.
On Thu, Mar 19, 2009 at 1:02 PM, Miles Sabin <miles@milessabin.com> wrote:
On Thu, Mar 19, 2009 at 1:02 PM, Miles Sabin <miles@milessabin.com> wrote:
On Thu, Mar 19, 2009 at 11:01 AM, Enes Fazli <fazli.enes@googlemail.com> wrote:
> your suggestion was correct. It works now and there is a last problem
> remaining. The Scala Files don't get build on project build but only if I
> save the file in the editor. So, I would need to manually open the scala
> files and save them every time I make a project clean.
Hmm ... do you have a .setting directory at the top-level of your
project? What's in it?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
Thu, 2009-03-19, 13:17
#6
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
On Thu, Mar 19, 2009 at 12:08 PM, Enes Fazli wrote:
> Sorry, in my there is only a .svn directory in my .settings directory.
OK, then I think your problem is that in creating your project from
Maven you didn't get the relevant Java builder settings set up.
Right click on your project in the package explorer, then,
Properties => Java Compiler => Building
Select "Enable project specific settings"
Deselect "Scrub output folders when cleaning projects"
Add "*.scala" to the list of Filtered resources.
Then do another clean build.
Nb. the above isn't necessary on trunk, which means that presumably
trunk gets on better with Maven? Josh?
Cheers,
Miles
Thu, 2009-03-19, 13:27
#7
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
Sorry, in my there is only a .svn directory in my .settings directory.
On Thu, Mar 19, 2009 at 1:07 PM, Enes Fazli <fazli.enes@googlemail.com> wrote:
On Thu, Mar 19, 2009 at 1:07 PM, Enes Fazli <fazli.enes@googlemail.com> wrote:
I have a .settings directory but there is only a .settings directory in it.
On Thu, Mar 19, 2009 at 1:02 PM, Miles Sabin <miles@milessabin.com> wrote:
On Thu, Mar 19, 2009 at 11:01 AM, Enes Fazli <fazli.enes@googlemail.com> wrote:
> your suggestion was correct. It works now and there is a last problem
> remaining. The Scala Files don't get build on project build but only if I
> save the file in the editor. So, I would need to manually open the scala
> files and save them every time I make a project clean.
Hmm ... do you have a .setting directory at the top-level of your
project? What's in it?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
Thu, 2009-03-19, 14:17
#8
Re: Problem using Scala Eclipse Plugin with Wicket Maven Proje
Thank you very much for your help. Everything works now as expected.
Regards,
Enes
On Thu, Mar 19, 2009 at 1:14 PM, Miles Sabin <miles@milessabin.com> wrote:
Regards,
Enes
On Thu, Mar 19, 2009 at 1:14 PM, Miles Sabin <miles@milessabin.com> wrote:
On Thu, Mar 19, 2009 at 12:08 PM, Enes Fazli <fazli.enes@googlemail.com> wrote:
> Sorry, in my there is only a .svn directory in my .settings directory.
OK, then I think your problem is that in creating your project from
Maven you didn't get the relevant Java builder settings set up.
Right click on your project in the package explorer, then,
Properties => Java Compiler => Building
Select "Enable project specific settings"
Deselect "Scrub output folders when cleaning projects"
Add "*.scala" to the list of Filtered resources.
Then do another clean build.
Nb. the above isn't necessary on trunk, which means that presumably
trunk gets on better with Maven? Josh?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
On Thu, Mar 19, 2009 at 9:35 AM, Enes Fazli wrote:
> I use several source folders in my project:
Unfortunately only one source and one output directory is currently
supported (as in, expected to work without difficulty).
However, you might be in luck if you make sure that you have only one
output folder for _all_ of your source folders.
Cheers,
Miles