fast-jar as default packaging

161 views
Skip to first unread message

Guillaume Smet

unread,
Feb 8, 2021, 4:37:40 AM2/8/21
to Quarkus Platform Coordination
Hi,

Just wanted to warn you that I just merged in master the fast-jar as default packaging PR.

Hopefully, this won't break your build but if it does, please come back to me and I'll help.

https://github.com/quarkusio/quarkus/wiki/Migration-Guide-1.12#fast-jar-as-default might be of some interest. The idea is that everything should work with fast-jar so if we have any issue, we need to fix them.

Thanks!

--
Guillaume

Claus Ibsen

unread,
Feb 8, 2021, 9:29:28 AM2/8/21
to Guillaume Smet, Quarkus Platform Coordination
Hi

Thanks for the heads-up about this "bigger" change.

I tried on the 1.11.1 release via code.quarkus.io to create a basic project (no selected extensions).
And then change to use fast-jar via

❯ cat src/main/resources/application.properties
quarkus.package.type=fast-jar

And then do a

❯ mvn clean package

And then look inside the target directory

> ls target

And there is this JAR:
code-with-quarkus-1.0.0-SNAPSHOT.jar

As an end user I would assume I could run this with

❯ java -jar target/code-with-quarkus-1.0.0-SNAPSHOT.jar
no main manifest attribute, in target/code-with-quarkus-1.0.0-SNAPSHOT.jar

I wonder if the user experience of this "fast jar" can be improved. Its not intuitive that you need to run a JAR that does NOT have your project name in it, but its always named quarkus-app JAR and its located in some sub folder of target, so its harder to location.

Existing users of quarkus would likely assume the "fast-jar" also generates a runner JAR for them to start, or some other named JAR directly in the target folder.
And users coming from Spring Boot have that same experience.

Before the 1.12 is released I wonder if there is time to improve this, or somehow better "educate" and help users.





--
You received this message because you are subscribed to the Google Groups "Quarkus Platform Coordination" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-platform-coo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-platform-coordination/CALt0%2Bo_%2BRHGoST8Rc5vYnFU0xL9zOz-f-H2-FbeGTZssDVL3cA%40mail.gmail.com.


--
Claus Ibsen
Senior Principal Software Engineer
Fuse Platform Architect
Red Hat Middleware
@davsclaus

Stuart Douglas

unread,
Feb 8, 2021, 3:08:37 PM2/8/21
to Claus Ibsen, Guillaume Smet, Quarkus Platform Coordination
On Tue, 9 Feb 2021 at 01:29, Claus Ibsen <cib...@redhat.com> wrote:
Hi

Thanks for the heads-up about this "bigger" change.

I tried on the 1.11.1 release via code.quarkus.io to create a basic project (no selected extensions).
And then change to use fast-jar via

❯ cat src/main/resources/application.properties
quarkus.package.type=fast-jar

And then do a

❯ mvn clean package

And then look inside the target directory

> ls target

And there is this JAR:
code-with-quarkus-1.0.0-SNAPSHOT.jar

As an end user I would assume I could run this with

❯ java -jar target/code-with-quarkus-1.0.0-SNAPSHOT.jar
no main manifest attribute, in target/code-with-quarkus-1.0.0-SNAPSHOT.jar

I wonder if the user experience of this "fast jar" can be improved. Its not intuitive that you need to run a JAR that does NOT have your project name in it, but its always named quarkus-app JAR and its located in some sub folder of target, so its harder to location.

The reason for this was so your application is 'self contained', and not mixed in with other random stuff in the target directory. Previously your app consisted of the runner jar and the lib directory but they were both in 'target' mixed in with all the other outputs that maven
generates, so it was not obvious which things your app actually needed. Fast jar packages everything into a directory to avoid this.

Stuart
 

Claus Ibsen

unread,
Feb 9, 2021, 3:35:24 AM2/9/21
to Stuart Douglas, Guillaume Smet, Quarkus Platform Coordination
On Mon, Feb 8, 2021 at 9:08 PM Stuart Douglas <sdou...@redhat.com> wrote:


On Tue, 9 Feb 2021 at 01:29, Claus Ibsen <cib...@redhat.com> wrote:
Hi

Thanks for the heads-up about this "bigger" change.

I tried on the 1.11.1 release via code.quarkus.io to create a basic project (no selected extensions).
And then change to use fast-jar via

❯ cat src/main/resources/application.properties
quarkus.package.type=fast-jar

And then do a

❯ mvn clean package

And then look inside the target directory

> ls target

And there is this JAR:
code-with-quarkus-1.0.0-SNAPSHOT.jar

As an end user I would assume I could run this with

❯ java -jar target/code-with-quarkus-1.0.0-SNAPSHOT.jar
no main manifest attribute, in target/code-with-quarkus-1.0.0-SNAPSHOT.jar

I wonder if the user experience of this "fast jar" can be improved. Its not intuitive that you need to run a JAR that does NOT have your project name in it, but its always named quarkus-app JAR and its located in some sub folder of target, so its harder to location.

The reason for this was so your application is 'self contained', and not mixed in with other random stuff in the target directory. Previously your app consisted of the runner jar and the lib directory but they were both in 'target' mixed in with all the other outputs that maven
generates, so it was not obvious which things your app actually needed. Fast jar packages everything into a directory to avoid this.


Okay that is a good reason. Is there a way to configure the name of the generated name so its not always quarkus-app.jar
And would it be make the user experience easier if a runner JAR was generated in the target folder that is a thin JAR to just start that application more easily.

So you can do

java -jar target/*-runner.jar

And it works the same as in 1.11 or older, and 1.12 onwards.
Reply all
Reply to author
Forward
0 new messages