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

Gradle plugin Uber-jar to use application.property quarkus.package.uber-jar=true like Maven #5036

Closed
oztimpower opened this issue Oct 30, 2019 · 10 comments · Fixed by #5060
Closed
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@oztimpower
Copy link
Contributor

Description
Maven has really simple Uber-jar creation via the application.property quarkus.package.uber-jar=true. Would it be possible to Gradle to also use this property.

Reason being, I'm seeing really weird behaviour using:

gradle clean
gradle build -x buildNative
gradle quarkusBuild --uber-jar
(or, gw clean build -x buildNative quarkusBuild --uber-jar)

It's incrementing the number on the runner ApplicationImpl. This needs to be "1", as it's hard-coded in Class.ForName on startup in the Amazon-Lambda Stream Handler I'm testing.


java.lang.ClassNotFoundException: io.quarkus.runner.ApplicationImpl1
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler.<clinit>(QuarkusStreamHandler.java:30)

Seems to be a bug. Every time I run the build (after a clean) it is still incrementing the version of this class.

It would be nice therefore to have the application.property used instead.

   0 Wed Oct 30 23:21:37 SGT 2019 io/quarkus/runner/
 3238 Wed Oct 30 23:21:37 SGT 2019 io/quarkus/runner/ApplicationImpl6.class
  527 Wed Oct 30 23:21:37 SGT 2019 io/quarkus/runner/GeneratedMain.class



@oztimpower oztimpower added the kind/enhancement New feature or request label Oct 30, 2019
@geoand
Copy link
Contributor

geoand commented Oct 30, 2019

Hi, with Quarkus 0.27 you can do:

./gradlew clean build -x native -x check -Dquarkus.package.uber-jar=true

And to get the uber-jar.

Can you give it a shot please?

@oztimpower
Copy link
Contributor Author

oztimpower commented Oct 30, 2019 via email

@oztimpower
Copy link
Contributor Author

Needless to say I don't have this issue with the Maven plugin (the version increment).

@geoand
Copy link
Contributor

geoand commented Oct 30, 2019

That is weird... Even with the clean you are seeing incremented ApplicationImpl?

@oztimpower
Copy link
Contributor Author

Yes, with clean it still kept incrementing. Seems to be a gradle cache issue.

I've just run it with --no-daemon and it's fine!

./gradlew clean build -x buildNative -x check -Dquarkus.package.uber-jar=true --no-daemon

     0 Wed Oct 30 23:54:00 SGT 2019 io/quarkus/runner/
  3230 Wed Oct 30 23:54:00 SGT 2019 io/quarkus/runner/ApplicationImpl1.class
   527 Wed Oct 30 23:54:00 SGT 2019 io/quarkus/runner/GeneratedMain.class

@geoand
Copy link
Contributor

geoand commented Oct 30, 2019

Wow! That's pretty crazy...

@stuartwdouglas
Copy link
Member

I don't think we need this count thing any more, I think it was to work around class loading issues for tests back when our internal tests did not have an isolated class loader.

@stuartwdouglas stuartwdouglas self-assigned this Oct 30, 2019
@geoand
Copy link
Contributor

geoand commented Oct 31, 2019

@oztimpower Would you be able to check and see if Stuart's #5060 PR fixes the issue with the gradle daemin?

@oztimpower
Copy link
Contributor Author

Yes, after multi-executions with the same Gradle daemon I confirm it's stable.

Much appreciated!

Validated below:

     0 Thu Oct 31 16:38:30 SGT 2019 io/quarkus/runner/
  3240 Thu Oct 31 16:38:30 SGT 2019 io/quarkus/runner/ApplicationImpl.class
   526 Thu Oct 31 16:38:30 SGT 2019 io/quarkus/runner/GeneratedMain.class

@geoand
Copy link
Contributor

geoand commented Oct 31, 2019

Thanks for checking @oztimpower!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants