Customer Registry quickstart: not all code generated?

Only Main and domain.Customer source was generated, though I see a lot of classes generated under target dir. So IntelliJ can’t import customer.api and won’t compile. sbt compile reported success.

BTW I had to deviate a bit from the quickstart, edited the plugins.sbt as follows:

Couldn’t find sbt-native-packager in sona under com.typesafe.sbt
Found in git page that should use com.github.sbt instead, and changed version to 1.9.8

Couldn’t find sbt-dynver. Found this bug report where someone suggested adding resolvers like below, that fixed it

resolvers += Classpaths.sbtPluginReleases

I’m trying the giter8 project template instead, and notice that it generates the counter_api.proto in the root folder, not under /api (unlike counter_domain.proto which is under /domain), so I tried doing that with the quickstart but not difference.

OK got past this, had to do Mark Directory AS > Generated Sources Root

Had a feeling that was the way but wasn’t working cause I was doing it on ‘classes’ but needed to do it on ‘scala-2.13’ directory.

Now error highlighting in Intellij works fine, it builds and deploys.

Hi @maristi ,

Sorry to hear that it was a bumpy ride, but thanks for letting us know of your troubles getting started with the Scala Kalix samples.

For the sbt plugins, there is a separate repository at sbt comes pre-configured with this resolver, so not sure why you could not resolve the plugins. Maybe your machine has some overrides or you are on a corporate network with a proxy in-between that does not let you resolve the plugins?

As far as I know IntelliJ does not figure out and mark up directories specifically as generated sources, but if I download the Customer Registry quickstart or sbt new the g8 value entity template, first compile it with sbt and then open the project with IntelliJ 2022.2.2 it finds all generated sourced and I get no squiggly lines, without any manual marking directories up as generated sources.

Could it be that you are on an older version of IntelliJ that does not behave as well?

Thanks Jonathan!.. and happy to see your quick response, I wasn’t sure how much support I’d get since posts here are few lately, makes me feel better about betting on this platform.

Hmm I’m on a fresh machine with no previous dev toolkits, just installed sbt too, and not in a corporate network. Do you see any issue with leaving the “resolvers += Classpaths.sbtPluginReleases” in plugins.sbt?

Using latest version of IntelliJ, but I did load the project before running sbt compile, so that’s a good suggestion I can try for a clean setup, though the way I got it now I think is fine.


Do you see any issue with leaving the “resolvers += Classpaths.sbtPluginReleases” in plugins.sbt?

I’d expect it to lead to having the sbt plugin releases repo in the plugin resolvers twice, so not a big problem.

If you run reload plugins to switch context to the “build project” and then show fullResolvers I think you can see if I’m right or if the releases repo is only in the list once.

Hmm tried doing a fresh project from the g8 template, compiled it, then import into IntelliJ… all source files disappear. Might be good to add a video of that to your YT channel, maybe there’s some setting on import that i’m doing wrong. Sorry i’m a sbt newbie, been using Gradle.

Going to continue with my previously loaded project that I got working by marking the output dir as sources root.

That should just work ™ without any special setting at import, so there is something strange going on that we haven’t seen before.

Please let us know if you figure out any more details that could be the cause. We haven’t heard of problems like this before so we do not have much to go on.

Might be good to add a video of that to your YT channel, …

I could have sworn we have exactly a video like that, but browsing I couldn’t find one. The closest we have is probably How to Create Kalix Java Development Projects - YouTube but that is Java centered, so not sure it is of much help for you since that is Java/Maven.