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

sbt-pack erroneously adds test dependencies to the delivery #142

Open
liebichw opened this issue Aug 28, 2018 · 6 comments
Open

sbt-pack erroneously adds test dependencies to the delivery #142

liebichw opened this issue Aug 28, 2018 · 6 comments

Comments

@liebichw
Copy link

I have a multi-module project.
projA depends on projB.
projB now has a test-only dependency on projC (like 'projB % projC % "test->test" ').

When I pack projA, projC is also included. But the dependencies of projC are not included. This is wrong, as projC should not be included at all (and as projC's dependencies are missing, it would not work anyways).

Tested with version 0.10.0 and 0.11, both show the offending behavior.

@xerial
Copy link
Owner

xerial commented Aug 28, 2018

I'm not sure why the projC is included, but as a workaround try packExclude := Seq("projC").

@liebichw
Copy link
Author

I tried the suggestion, but it did not work out. According to the help comment for "packExclude", this only excludes the dependencies of "projC", not projC itself.
Isn't it so that the test dependencies are included in the runtime dependencies?

@xerial
Copy link
Owner

xerial commented Aug 29, 2018

No. packExclude removes both the dependencies of the specified project and the project itself.
If projC is still included in your depedencies, I think your build configuration includes such dependency somewhere,

Check runtime:libraryDependencies of your project.

@liebichw
Copy link
Author

liebichw commented Sep 3, 2018

Sorry, no, that is not what I see. projC is included, but the libraryDependencies of projC are not (!).
I prepared a mini-demo-project in https://github.com/liebichw/pack-bug-demo - as you see there, projC depends on projB which has a test-dependency on projA - but packing projC still includes projA.

@xerial
Copy link
Owner

xerial commented Sep 4, 2018

ok.

  • At least using 0.11 is a must. 0.10.0 has a bug for multi-module projects.
  • And it seems there are no runtime dependencies for projC (-> and projB) in your example. Only test dependency to log4j exists.

@liebichw
Copy link
Author

liebichw commented Sep 12, 2018

I updated by dummy project to use sbt-pack 0.11.
It did not help.
Running
projC;pack
in the sbt console still created an output structure where projA is still included in the lib/ directory, even though projB only has a test dependency on it.

And yes, in my demo project projC has no dependency - adding further libraries and subprojects is not needed to demonstrate the problem I have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants