Skip to content

In LauncherJarPlugin, when the project script (i.e. "main script") name is the same as the main class script name, the main class script simply overwriters the project script #1687

@matomer

Description

@matomer

Reproduce

Create a project with the following files:
project/plugins.sbt:

addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.1")

build.sbt:

enablePlugins(LauncherJarPlugin, BatStartScriptPlugin)

name := "main class script overrides project script"

MainClassScriptOverridesProjectScript.scala:

object MainClassScriptOverridesProjectScript extends App {
  println("override")

}

Run stage in sbt.

problem

The task will only create one script called main-class-script-overrides-project-script. When the script is run, the result is the error The syntax of the command is incorrect..

It seems that the script for the class overwrites the main script that executes the launcher.

expectation

Two scripts - one for starting the main class and one for starting the launcher (the same as would be the case if the names of the main class script and the project script weren't the same).

Alternatively there should be an error/warning message that warns about the main class script overwriting the project script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buguniversalZip, tar.gz, tgz and bash issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions