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

前端 未结 7 1302
执笔经年
执笔经年 2020-12-07 09:05

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 wor

7条回答
  •  天命终不由人
    2020-12-07 09:52

    Here's a small project link(https://github.com/mebinjacob/mongo-scala-java-maven-poc) that I did using scala, java and mongo db.

    Note in the pom.xml of the project one can specify the source folder of scala files it can be same as that of java or a different folder like src/main/scala. There is no mandate for scala classes to be on a separate src folders. I have tried both of them and both of them work great. The snippet of the pom that I am referring to is

        
        
            
                org.scala-tools
                maven-scala-plugin
                
                    
                        
                            compile
                            testCompile
                        
                    
                
                
                    src/main/scala
                    
                        -Xms64m
                        -Xmx1024m
                    
                
            
        
    
    

提交回复
热议问题