From 896aa161b95d335610adbd11369e97e04b9eb144 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 4 Jun 2021 16:50:44 +1000 Subject: [PATCH] Capabilities are not persisted Fixes #17592 (cherry picked from commit 2e28b511505d7fb819cff006e923eed6fc85122e) --- .../src/main/java/io/quarkus/bootstrap/model/AppModel.java | 2 ++ .../java/io/quarkus/bootstrap/model/PersistentAppModel.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/AppModel.java b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/AppModel.java index 453258db877f4..67983300d10ec 100644 --- a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/AppModel.java +++ b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/AppModel.java @@ -16,6 +16,8 @@ /** * A representation of the Quarkus dependency model for a given application. * + * Changes made to this class should also be reflected in {@link PersistentAppModel} + * * @author Alexey Loubyansky */ public class AppModel implements Serializable { diff --git a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PersistentAppModel.java b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PersistentAppModel.java index 203276a573130..8d027a545b43f 100644 --- a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PersistentAppModel.java +++ b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PersistentAppModel.java @@ -29,6 +29,7 @@ public class PersistentAppModel implements Serializable { private Set lesserPriorityArtifacts; private Set localProjectArtifacts; private Map platformProperties; + private Map capabilitiesContracts; private String userProvidersDirectory; public PersistentAppModel(String baseName, Map> paths, AppModel appModel, @@ -54,6 +55,7 @@ public PersistentAppModel(String baseName, Map> pat parentFirstArtifacts = new HashSet<>(appModel.getParentFirstArtifacts()); runnerParentFirstArtifacts = new HashSet<>(appModel.getRunnerParentFirstArtifacts()); lesserPriorityArtifacts = new HashSet<>(appModel.getLesserPriorityArtifacts()); + capabilitiesContracts = new HashMap<>(appModel.getCapabilityContracts()); } public String getUserProvidersDirectory() { @@ -85,6 +87,7 @@ public AppModel getAppModel(Path root) { for (AppArtifactKey i : localProjectArtifacts) { model.addLocalProjectArtifact(i); } + model.setCapabilitiesContracts(capabilitiesContracts); final PlatformImportsImpl pi = new PlatformImportsImpl(); pi.setPlatformProperties(platformProperties); model.setPlatformImports(pi);