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

Native image gets generated even when all classes are unchanged / up to date #5588

Closed
rsvoboda opened this issue Nov 19, 2019 · 5 comments
Closed
Labels
kind/bug Something isn't working
Milestone

Comments

@rsvoboda
Copy link
Member

Native image gets generated even when all classes unchanged / are up to date
maven-compiler-plugin detects that case, quarkus-maven-plugin always runs the build

Discussed in https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/skip.20native.20%28re%29build.2C.20run.20just.20test/near/181113795

mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=getting-started \
    -DclassName="org.acme.quickstart.GreetingResource" \
    -Dpath="/hello"
mvn verify -Dnative  # runs the native compilation
mvn verify -Dnative  # second run should not run the native compilation but it runs it
@rsvoboda rsvoboda added the kind/bug Something isn't working label Nov 19, 2019
@mkouba
Copy link
Contributor

mkouba commented Nov 19, 2019

For the record - the fact that no class has changed does not imply that the native image generation should be skipped - for example you can add extesions, change the configuration, resource files, etc.

It's possible to skip the native image manually. Which is not very practical but sometimes it could be useful ;-)

  • configure the maven-failsafe-plugin outside the "native" profile and skip the "native" profile activation for the second run:
    mvn verify -Dnative
    # This one will reuse the existing native image
    mvn verify
    
  • configure the maven-failsafe-plugin and do not use the "native" profile at all:
    mvn verify -Dquarkus.package.type=native
    mvn verify
    

@rsvoboda
Copy link
Member Author

you can add extesions, change the configuration, resource files

dev mode can detect these things, standard quarkus build could leverage these capabilities too

workaround with failsafe

I'd rather have mvn verify -Dquarkus.native.skip-build=true for better out-of-the-box experience

@gsmet
Copy link
Member

gsmet commented Nov 19, 2019 via email

@rsvoboda
Copy link
Member Author

I think #5609 addresses this quite well

Native image gets built only once when following commands are used

mvn verify -Dnative
mvn failsafe:integration-test

@rsvoboda
Copy link
Member Author

@mkouba / @gsmet I think this can be closed, 5609 is good enough for me.

@mkouba mkouba closed this as completed Dec 20, 2019
@gsmet gsmet added this to the 1.1.0.CR1 milestone Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants