apache / apache/maven-mvnd

quarkus-maven-plugin:build keeps stale classloaders

Open
#331 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

As of Quarkus 1.11.0.Final, the build mojo of quarkus-maven-plugin keeps stale class loaders of deployment artifacts built from the same source tree with the same daemon.

Generic steps to reproduce:

1. Find some simple itest in the quarkus, e.g. jsonb
2. Break something in some deployment module used by the test, e.g. fully remove the body of `io.quarkus.jsonb.deployment.JsonbProcessor.build(BuildProducer, BuildProducer, BuildProducer, BuildProducer, CombinedIndexBuildItem)` method.
3. Rebuild `quarkus-jsonb-deployment` to make sure that it is installed
4. Build the test with a fresh mvnd
```
cd integration-tests/jsonb
mvnd --stop
mvnd clean verify -Dnative
```
The test should fail, because the `JsonbProcessor` is broken
5. Revert the breakage in `io.quarkus.jsonb.deployment.JsonbProcessor.build(BuildProducer, BuildProducer, BuildProducer, BuildProducer, CombinedIndexBuildItem)` method,
6. Rebuild `quarkus-jsonb-deployment` with `mvnd` to make sure that it is installed
7. Rebuild the test project
```
cd integration-tests/jsonb
mvnd --stop
mvnd clean verify -Dnative
```

Expected: the test should pass, because the JsonbProcessor is fixed now
Actual: the test still fails, because the quarkus-maven-plugin classloader is cached and it contains an outdated version of `JsonbProcessor`

Workaround: manually kill the daemon when any of the deployment modules was changed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the quarkus-maven-plugin build mojo and the classloader caching behavior described in the issue. Reproduce from integration-tests/jsonb with mvnd clean verify -Dnative after changing and restoring JsonbProcessor, then verify that rebuilding quarkus-jsonb-deployment no longer requires manually stopping the daemon and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.