Scala import not working - object is not a member of package, sbt preppends current package namespace in imports

后端 未结 12 1996
死守一世寂寞
死守一世寂寞 2020-12-14 14:28

I have an issue when trying to import in scala. The object Database exists under com.me.project.database but when I try to import it:



        
12条回答
  •  独厮守ぢ
    2020-12-14 14:49

    Java -> Scala conversion without cleaning

    Don't forget to clean if you convert some file in a project from Java to Scala. I had a continuous integration build running where I couldn't get things to work, even though the build was working locally, after I had converted a Java class into a Scala object. Solution: add 'clean' to the build procedure on the CI server. The name of the generated .class file in Scala is slightly different than for a Java class, I believe, so this is very likely what was causing the issue.

提交回复
热议问题