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

Add a warning when re-augmenting non-mutable Quarkus application #34816

Closed
rsvoboda opened this issue Jul 18, 2023 · 3 comments · Fixed by #34845
Closed

Add a warning when re-augmenting non-mutable Quarkus application #34816

rsvoboda opened this issue Jul 18, 2023 · 3 comments · Fixed by #34845
Labels
kind/enhancement New feature or request
Milestone

Comments

@rsvoboda
Copy link
Member

Description

The proper flow to re-augment your application with a different build time configuration is

mvn clean install -Dquarkus.package.type=mutable-jar
java -Dquarkus.launch.rebuild=true -Dfoo=bar -jar target/quarkus-app/quarkus-run.jar

But one can easily forget to add -Dquarkus.package.type=mutable-jar when building the app.

In that case the error complains about NSFE for deployment-class-path.dat and the log looks like this:

java -Dquarkus.launch.rebuild=true -jar target/quarkus-app/quarkus-run.jar 
Exception in thread "main" java.nio.file.NoSuchFileException: /Users/rsvoboda/Downloads/code-with-quarkus/target/quarkus-app/lib/deployment/deployment-class-path.dat
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doReaugment(QuarkusEntryPoint.java:72)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:48)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)

Implementation ideas

Add more clear error message saying that re-augmentation was requested, but the application wasn't built with quarkus.package.type=mutable-jar

@rsvoboda rsvoboda added the kind/enhancement New feature or request label Jul 18, 2023
@geoand
Copy link
Contributor

geoand commented Jul 19, 2023

Sounds reasonable. @rsvoboda would you like to update the error message?

@rsvoboda
Copy link
Member Author

Sure. I will adjust https://github.com/quarkusio/quarkus/blob/main/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/QuarkusEntryPoint.java#L69 to first check if the file exists.

In case it doesn't exist, error message to be printed and return from the method immediately. Sounds good @geoand ?

@geoand
Copy link
Contributor

geoand commented Jul 19, 2023

👌

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.

2 participants