luontola / idea-sbt-plugin

IntelliJ IDEA plugin for integration with SBT (Simple Build Tool) in order to compile Scala projects easily and quickly [UNMAINTAINED]
http://plugins.intellij.net/plugin/?idea&id=5007
Apache License 2.0
178 stars 28 forks source link

Version for jar not set properly when changed in build.sbt #121

Open skyler3d opened 7 years ago

skyler3d commented 7 years ago

Hi there,

I've noticed in a couple of my projects, when I update the application's version build.sbt. I've also noticed it will only do this when I run assembly in the SBT shell inside of IntelliJ. However, if I create a run configuration that runs assembly it does pull the latest version.

To replicate this:

  1. Set version in build.sbt (say 1.0)
  2. Open the SBT shell, run assembly
  3. It should build the correct version
  4. Change the version in build.sbt (say 1.1) and run assembly again
  5. It will build assembly-1.0.jar instead of assembly-1.1.jar

If you run assembly in a terminal outside of IntelliJ, it will build the correct version. Also if you restart IntelliJ it will resolve the issue.

SBT Plugin Version: 1.8.0 IntelliJ Version: 2017.2.5 SBT Version: 0.13.16 Assembly Version: 0.14.5

jastice commented 7 years ago

This is because in the sbt shell you need to do a reload command after changing any settings in the build.sbt. If you use a run config, restart intellij or open a shell instance, this will start a new sbt instance which loads the settings, so that is why you see it working in those cases. To relaod within the shell, just type reload or do a project refresh from IntelliJ.

by the way, the place to report intellij-related issues is https://youtrack.jetbrains.com/issues/SCL