Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run windows:packageBin #1322

Closed
dubaut opened this issue Mar 26, 2020 · 1 comment
Closed

Cannot run windows:packageBin #1322

dubaut opened this issue Mar 26, 2020 · 1 comment
Labels

Comments

@dubaut
Copy link

dubaut commented Mar 26, 2020

I followed the instructions here and created the following build.sbt:

name := "GlobalConfigEditor"

version := "0.3-SNAPSHOT"

scalaVersion := "2.13.1"

enablePlugins(WindowsPlugin)

val mainClassName = "globalconfig.ConfigEditorApplication"
mainClass in assembly := Some(mainClassName)
assemblyJarName in assembly := s"UniqaGlobalConfigEditor-$version.jar"

assemblyMergeStrategy in assembly := {
  case PathList("META-INF", xs@_*) => MergeStrategy.discard
  case PathList("reference.conf") => MergeStrategy.concat
  case x => MergeStrategy.first
}

// general package information (can be scoped to Windows)
maintainer := "J. Doe <[email protected]"
packageSummary := "test-windows"
packageDescription := """Test Windows MSI."""

// wix build information
wixProductId := "ce07be71-510d-414a-92d4-dff47631848a"
wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424"

libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.9"
libraryDependencies += "commons-io" % "commons-io" % "2.6"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "com.typesafe.scala-logging" % "scala-logging_2.13" % "3.9.2"
libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % "2.6.3"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.1" % "test"
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test
libraryDependencies += "org.mockito" % "mockito-scala_2.13" % "1.11.3"
libraryDependencies += "org.mockito" % "mockito-scala-scalatest_2.13" % "1.11.3"

Expected behaviour

  1. The task windows:packageBin appears in IntelliJ's sbt side-bar.
  2. I can execute the task windows:packageBin in the sbt-shell.

Actual behaviour

  1. The task does not appear in IntelliJ's sbt integration.
  2. Executing the task in sbt-shell leads to the following error:
[error] stack trace is suppressed; run 'last wixProductXml' for the full output
[error] (wixProductXml) java.util.NoSuchElementException: key not found:
[error] Total time: 0 s, completed 24.03.2020 22:15:51

Executing wixProductXml leads to the following error:

[error] Expected ';'
[error] Expected ':'
[error] Not a valid key: wixProductXml (similar: wixProductId, wixProductUpgradeId, products)
[error] {file:/C:/Users/GlobalConfigEditor/}uniqaglobalconfigeditor/wixProductXml
[error]                                                                                                              ^
[IJ]sbt:UniqaGlobalConfigEditor>
[IJ]sbt:UniqaGlobalConfigEditor>

Information

  • What sbt-native-packager are you using 1.7.0
  • What sbt version 1.3.8
  • What is your build system Windows 10
  • What package are you building Windows MSI
@muuki88 muuki88 added the windows label Apr 2, 2020
@muuki88
Copy link
Contributor

muuki88 commented Apr 2, 2020

Hi,

Thanks for the detailed bug report 👍 😃

For the intellij part you need to ask the IntelliJ folks for this. sbt-native-packager is no different that any other sbt plugin. The devs at IntelliJ do are really great job, but integrating with SBT is not trivial.

Regarding window:packageBin not working.

It's best to start with the Getting Started, which states that you enable an archetype, which is build configuration for a specific output application type. In most cases you do

enablePlugins(JavaAppPackaging)

which is enough.

I also noticed that you have added sbt-assembly. Usually you only need either one, sbt-native-packager or assembly.

@muuki88 muuki88 closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants