Skip to content

Profiles both configured in :default and :uberjar are not packaged into uberjar #2733

@nbardiuk

Description

@nbardiuk

Profiles both configured in :default and :uberjar are not packaged into uberjar.

  1. Given new project with custom profile :deps with its own dependencies

Scenario A: the :deps profile is included in :default and :uberjar

  :target-path "target/%s"
  :uberjar-name "uber.jar"
  :profiles {:default [:leiningen/default :deps]
             :uberjar [:deps]
             :deps {:dependencies [[org.postgresql/postgresql "42.2.19"]]}}

Scenario B: the :deps profile is included only in :uberjar

  :target-path "target/%s"
  :uberjar-name "uber.jar"
  :profiles {:uberjar [:deps]
             :deps {:dependencies [[org.postgresql/postgresql "42.2.19"]]}}
  1. When I package the application and explore the final uberjar
lein do clean, uberjar && unzip -l target/uber.jar | grep postgres
  1. Then
  • Scenario A: the jar does not contain PostgreSQL classes
  • Scenario B: the jar contains PostgreSQL classes

Expected behavior
In both scenarios, the uberjar should contain PostgreSQL classes

Environment

  • Leiningen Version: 2.9.5
  • Leiningen installation method: nix.
  • JDK Version: OpenJDK version "11.0.1".
  • OS: macOS 11.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions