Fix integration with Micronaut Control Panel #715
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit provides a fix for the control panel not being loaded when using Micronaut 4.6. It turns out that this highlighted a deeper issue with classloading in test resources. In particular, there are a couple of problems:
Fixing 2 isn't trivial, since we need a single dependency graph on the server side. In order to avoid breaking changes, and to make sure that the solution works both for Maven and Gradle, this commit introduces a new utility in the
TestResourcesClasspath
class from thebuild-tools
module, so that the Maven and Gradle plugins can filter out dependencies which are already packaged into the jar (e.g Micronaut Core, Micronaut Context, ...).This fixes the loading of the control panel module, in a backwards compatible way. In addition, it should fix the issue for user-written custom modules too. However, this will not prevent modules which are written for an
incompatible version of Micronaut to break when loaded in the server.
Fixes #705
Important : the complete fix will require changes in both the Gradle and Maven plugins to use that new method for filtering the classpath.