Avoid duplication of platform descriptions and imported Platform Boms in the PlatformImporstImpl
#44146
Labels
area/housekeeping
Issue type for generalized tasks not related to bugs or enhancements
Description
I'm currently testing the compatibility of tasks like QuarkusInfo with the configuration cache. The main challenge lies in providing a valid ApplicationModel generated by
QuarkusApplicationModelTask
. When executing the task, the output returns "no BOM or extensions are found."Currently, we're supplying the platform configuration to the
QuarkusApplicationModelTask
, where we instantiate a new PlatformImportsImpl and attempt to set platform properties and descriptors. However, the platform configuration is not being resolved correctly.The root cause is that the
PlatformImports
used in theApplicationModelBuilder
does not contain the platform BOM because the existing logic in the task isn't applied due to the platform configuration not being resolved.To address this issue, we could use the
PlatformImports
instance of theApplicationDeploymentClasspathBuilder
as an input to the task. Additionally, to avoid issues like #43258, we should skip forcing the resolution and prevent breaking conditional dependencies by retrieving the FileCollection from the incoming dependencies of the Quarkus platform configuration without immediately resolving them. This approach actually fixes the current issue.However, during my tests, I found that we're missing caching on the
QuarkusGenerateCode
andQuarkusBuildTasks
tasks because PlatformImportsImpl isn't consistent across builds. When resolving the dependency, we're using the static platformImports ofApplicationDeploymentClasspathBuilder
, which causes it to always go through(inPlatformImportsImpl
):This creates new BOM coordinates for the same descriptor on every build. The same problem occurs with
importedPlatformBoms
:These inconsistencies prevent the build cache from working as expected.
Implementation ideas
Avoid the duplication in
PlatformImporstImpl
The text was updated successfully, but these errors were encountered: