IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by : choosing “Edit configurations” from the “Run” menu (or the toolbar popup) click the “+” button to add a configuration and select “SBT Task” as the type of configuration you want to make.

How do I run an sbt Assembly in IntelliJ?

IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by : choosing “Edit configurations” from the “Run” menu (or the toolbar popup) click the “+” button to add a configuration and select “SBT Task” as the type of configuration you want to make.

How do I open an existing sbt project in IntelliJ?

  1. If no project is currently opened in IntelliJ IDEA, click Open on the welcome screen. Otherwise, select File | Open from the main menu.
  2. In the dialog that opens, select a file that contains your sbt project description build. sbt. …
  3. In the dialog that opens, click Select as Project.

How import sbt project to IntelliJ?

  1. From the Run menu, select Run.
  2. Click Edit Configurations….
  3. Click + (Add New Configuration).
  4. Select SBT Task.
  5. Name your configuration.
  6. In the Tasks field, enter runAll .
  7. Click Run. A Run tab opens and you should see messages from the build, with the services starting up at the end:

How do I get sbt tab in IntelliJ?

The sbt tool window is enabled automatically when you create or open your sbt project. Click sbt on the right sidebar to open the tool window. The tool window displays the sbt linked projects, their tasks, dependencies, and all changes made to the underlying build. sbt file.

How can I get SBT version?

Running the command, “sbt sbt-version” will simply output your current directory and the version number. There’s a difference how the sbtVersion task works in and outside a SBT project. When in a SBT project, sbtVersion displays the version of SBT used by the project and its subprojects.

Where are SBT dependencies stored?

All new SBT versions (after 0.7. x ) by default put the downloaded JARS into the . ivy2 directory in your home directory. If you are using Linux, this is usually /home/<username>/.

How do I import a project into IntelliJ?

  1. Open IntelliJ IDEA and close any existing project.
  2. From the Welcome screen, click Import Project. …
  3. Navigate to your Maven project and select the top-level folder. …
  4. Click OK. …
  5. For the Import project from external model value, select Maven and click Next.

How do I enable auto import in IntelliJ?

Automatically add import statements You can configure the IDE to automatically add import statements if there are no options to choose from. In the Settings/Preferences dialog ( Ctrl+Alt+S ) , click Editor | General | Auto Import. Select the Add unambiguous imports on the fly checkbox, and apply the changes.

How run Scala object in IntelliJ?
  1. Create or import a Scala project as you would normally create or import any other project in IntelliJ IDEA.
  2. Open your application in the editor.
  3. Press Shift+F10 to execute the application. Alternatively, in the left gutter of the editor, click the. icon and select Run ‘name’.
Article first time published on

What is SBT project?

sbt is an open-source build tool for Scala and Java projects, similar to Apache’s Maven and Ant. Its main features are: Native support for compiling Scala code and integrating with many Scala test frameworks. … Integration with the Scala interpreter for rapid iteration and debugging. Support for mixed Java/Scala projects.

What is SBT update?

update resolves dependencies according to the settings in a build file, such as libraryDependencies and resolvers . Other tasks use the output of update (an UpdateReport ) to form various classpaths. Tasks that in turn use these classpaths, such as compile or run , thus indirectly depend on update .

What does SBT clean do?

CommandDescriptioncleanDeletes all generated files (in the target directory).compileCompiles the main sources (in src/main/scala and src/main/java directories).testCompiles and runs all tests.

Why SBT shell not showing in IntelliJ?

In Intellij 2018, under Preferences – Build, Execution, Deployment – Build Tools – sbt , check ” Use sbt shell for build and import (requires sbt 0.13. 5+) “. Then restart Intellij. The sbt shell tool window tab will appear in the bottom pane (if not, select it from View – Tool Windows – sbt shell ).

Which version of Scala does SBT use?

sbt’s Scala version sbt uses that same version of Scala to compile the build definitions that you write for your project because they use sbt APIs. This version of Scala is fixed for a specific sbt release and cannot be changed. For sbt 1.5. 6, this version is Scala 2.12.

How do I download Scala plugin for IntelliJ?

To install Scala plugin, press Ctrl+Alt+S , open the Plugins page, browse repositories to locate the Scala plugin, click Install and restart IntelliJ IDEA. Now you can successfully check out from VCS, create, or import Scala projects.

Does sbt use Maven?

Resolvers. Not all packages live on the same server; sbt uses the standard Maven2 repository by default. If your dependency isn’t on one of the default repositories, you’ll have to add a resolver to help Ivy find it.

How do we specify dependencies using sbt?

You can use both managed and unmanaged dependencies in your SBT projects. If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.

Where is sbt local repository?

The publishLocal action is used to publish your project to your Ivy local file repository, which is usually located at $HOME/. ivy2/local/ . You can then use this project from other projects on the same machine.

Does sbt install Scala?

1 Answer. No you don’t need it. sbt will download Scala for you. If you install sbt-extras (basically just a script) you don’t even need to download sbt : it will automatically download the sbt launcher you need.

How do I check my version of Java?

Type “java -version” into the Command Prompt, then press Enter on your keyboard. After a moment, your screen should display the information your computer has about Java, including what version you have installed.

How do I change the Scala version in IntelliJ?

 In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.

How do I enable gradle Auto Import in Intellij?

Go to File > Settings (or hit Ctrl + Alt + s ), and navigate to Build, Execution, Deployment > Build Tools > Gradle. Select Automatically import this project on change to build script files and hit OK: JetBrains, who created IntelliJ IDEA, say that this setting can slow things down on large projects.

How do I get Maven dependencies in IntelliJ?

  1. Open your POM in the editor.
  2. Press Alt+Insert to open the Generate context menu.
  3. From the context menu, select Dependency or Dependency Template for quick search.
  4. In the dialog that opens either search for artifacts or for classes if you switch to the Search for class tab. tip.

How do I resolve import issues in Intellij?

  1. Project Structure ( Ctrl + Alt + Shift + S ).
  2. Modules.
  3. Select your problem module.
  4. Change tab on top of window “Sources”.
  5. Remove unwanted source roots. Keep one and add src and test source roots in this root.

How do I run the Gradle project in IntelliJ?

From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. icon. In the list that opens, select Run Gradle task. In the Select Gradle Task dialog, specify the project and the task that you want to execute before launching the project.

How do I run an existing Java project in IntelliJ?

  1. Launch IntelliJ IDEA. …
  2. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.
  3. When you import or clone a project for the first time, IntelliJ IDEA analyzes it.

How do I import a gradle project into IntelliJ?

  1. Open the Gradle tool window.
  2. In the Gradle tool window, click. to attach a Gradle project.
  3. In the dialog that opens, select the desired build. …
  4. In the Import Module from Gradle window, specify options for the Gradle project that you are trying to link and click OK.

How do I run SBT in debug mode?

  1. Edit Configs. In the top right corner of the Intellij window is a drop down. …
  2. Launch SBT in debug mode. Open a terminal and start sbt in debug mode: …
  3. Run the debugger. Click on the Green bug next to ‘Edit Configurations’ from before.
  4. Set breakpoints and run.

How do I run a Scala worksheet in Intellij?

  1. Create a Scala worksheet file and open it in the editor.
  2. Add your code. …
  3. Click.

What is difference between SBT and Maven?

Maven allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. … On the other hand, SBT is detailed as “An open-source build tool for Scala and Java projects”. It is similar to Java’s Maven and Ant.