Alex Rivera | Logout

Building a scala app with maven (that has java source mixed in)

Asked 2008-12-03T03:22:04.963
63

I have an application where I would like to have mixed Java and Scala source (actually its migrating a java app to scala - but a bit at a time).

I can make this work in IDEs just fine, very nice. But I am not sure how to do this with maven - scalac can compile java and scala intertwined, but how to I set up maven for the module?

Also, does my scala source have to be a different folder to the java?

Edit
Report

1 Answer

12

Yeah, the scala part has to be in a separate module and in src/main/scala directory. Maven regards mixed source like this as heresy.

You enable scala compilation by importing the scala maven plugin. The "usage" page as a good example.

answered 2008-12-03T04:04:37.937

Your Answer