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

Uberjar does not include add dependencies #9068

Closed
oscarfh opened this issue May 4, 2020 · 7 comments · Fixed by #9865
Closed

Uberjar does not include add dependencies #9068

oscarfh opened this issue May 4, 2020 · 7 comments · Fixed by #9865
Assignees
Labels
area/bootstrap kind/bug Something isn't working
Milestone

Comments

@oscarfh
Copy link
Contributor

oscarfh commented May 4, 2020

Describe the bug
This is a project created from code.quarkus.io and configured to generate a uber jar and to use com.google.common.base.Strings class.
It will work if ran from maven (./mvn quarkus:dev), but not from the uber jar (java -jar ...) due to a missing dependency (the above mentioned class)

Expected behavior
Both should run.

Actual behavior
Only the maven version runs, because the development version seems to get this class from the dependency quarkus-ide-launcher-1.4.1.Final.jar.
It can be even worse, is case the version executed in dev is different than the one executed on the environment.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout the project
  2. Run with maven -> calling http://localhost:8080/hello works
  3. Generate the uber jar (or use the one I added to the projecT)
  4. See that you cannot call
@oscarfh oscarfh added the kind/bug Something isn't working label May 4, 2020
@geoand
Copy link
Contributor

geoand commented May 5, 2020

I don't think this is a bug TBH. You haven't added Guava to your pom.xml, so it most certainly does not end up in the built jar.

@oscarfh
Copy link
Contributor Author

oscarfh commented May 5, 2020

@geoand I agree, but then it should fail in the dev mode, right? My problem is not that it does not work, my problem is that the behavior is different depending how I start it up,

@geoand
Copy link
Contributor

geoand commented May 5, 2020

Right, ideally it should. Problem is that devmode has some dependencies of it's own that are being picked up in this case.

cc @stuartwdouglas @aloubyansky

@geoand
Copy link
Contributor

geoand commented May 6, 2020

@oscarfh Thank you for volunteeting. The best person to help you out and / or coordinate efforts is @aloubyansky who has steadily been improving our Gradle support with difficult to make fixes.

@aloubyansky
Copy link
Member

Ideally, it should simply fail to build. And even compile. The IDE should be highlighting this as a missing dependency. I think we should review our IDE launcher implementation to avoid this kind of issues. It enables not only guava but all sorts of other dependencies during development that won't be there at runtime.

@stuartwdouglas
Copy link
Member

The only real option here would be to shade all the IDE launcher dependencies, although we will need to be careful about which ones to shade.

@geoand
Copy link
Contributor

geoand commented May 21, 2020

+1 for shading to avoid such issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bootstrap kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants