How to work efficiently with SBT, Spark and “provided” dependencies?

前端 未结 8 729
野性不改
野性不改 2021-01-31 02:47

I\'m building an Apache Spark application in Scala and I\'m using SBT to build it. Here is the thing:

  1. when I\'m developing under IntelliJ IDEA, I want Spark depend
8条回答
  •  猫巷女王i
    2021-01-31 03:29

    [Obsolete] See new answer "Use the new 'Include dependencies with "Provided" scope' in an IntelliJ configuration." answer.

    The easiest way to add provided dependencies to debug a task with IntelliJ is to:

    • Right-click src/main/scala
    • Select Mark Directory as... > Test Sources Root

    This tells IntelliJ to treat src/main/scala as a test folder for which it adds all the dependencies tagged as provided to any run config (debug/run).

    Every time you do a SBT refresh, redo these step as IntelliJ will reset the folder to a regular source folder.

提交回复
热议问题