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

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

Open
nbardiuk opened this issue Mar 20, 2021 · 1 comment
Labels

Comments

@nbardiuk
Copy link

nbardiuk commented Mar 20, 2021

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.
@nbardiuk
Copy link
Author

as a workaround, I am using aliases with deps profile for development commands:

  :target-path "target/%s"
  :uberjar-name "uber.jar"
  :profiles {:uberjar [:deps]
             :deps {:dependencies [[org.postgresql/postgresql "42.2.19"]]}
  :aliases {"test" ["with-profile" "+deps" "test"]
            "repl" ["with-profile" "+deps" "repl"]}

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