scalaslickslick-codegen

How to add auto-generated slick code to classpath


I generated source code using the method described here

https://github.com/slick/slick-codegen-example/blob/master/build.sbt

This method works and now when I do compile I can see that the auto-generated Target.scala file is being successfully compiled as Tables.class

enter image description here

but in my source code, If I try to import the autogenerated class file. it says cannot resolve symbol demo

enter image description here


Solution

  • This is caused by IntelliJ can't recognize the generated code, you can try to mark target/scala-2.11/src_managed/slick/ this as Sources Root. like:

    enter image description here