From ceca800b873c55f4215c0d55c3874558c1b6f1c8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Denise Date: Wed, 25 Oct 2023 16:47:18 +0200 Subject: [PATCH] Resolve plugins and config-gen before packages resolution --- .../org/wildfly/galleon/plugin/WfInstallPlugin.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/galleon-plugins/src/main/java/org/wildfly/galleon/plugin/WfInstallPlugin.java b/galleon-plugins/src/main/java/org/wildfly/galleon/plugin/WfInstallPlugin.java index 1997f6c0..64535de4 100644 --- a/galleon-plugins/src/main/java/org/wildfly/galleon/plugin/WfInstallPlugin.java +++ b/galleon-plugins/src/main/java/org/wildfly/galleon/plugin/WfInstallPlugin.java @@ -113,6 +113,7 @@ interface ArtifactResolver { private static final String CONFIG_GEN_METHOD = "generate"; private static final String CONFIG_GEN_GA = "org.wildfly.galleon-plugins:wildfly-config-gen"; + private static final String GALLEON_PLUGINS_GA = "org.wildfly.galleon-plugins:wildfly-galleon-plugins"; private static final String CONFIG_GEN_CLASS = "org.wildfly.galleon.plugin.config.generator.WfConfigGenerator"; private static final String CLI_SCRIPT_RUNNER_CLASS = "org.wildfly.galleon.plugin.config.generator.CliScriptRunner"; private static final String CLI_SCRIPT_RUNNER_METHOD = "runCliScript"; @@ -330,9 +331,13 @@ public void postInstall(ProvisioningRuntime runtime) throws ProvisioningExceptio // org.jboss.modules:jboss-modules // org.wildfly.core:wildfly-cli // org.wildfly.galleon-plugins:wildfly-config-gen + // org.wildfly.galleon-plugins:wildfly-galleon-plugins if (versionProps.containsKey(CONFIG_GEN_GA)) { gaToProducer.put(CONFIG_GEN_GA, fp.getFPID().getProducer()); } + if (versionProps.containsKey(GALLEON_PLUGINS_GA)) { + gaToProducer.put(GALLEON_PLUGINS_GA, fp.getFPID().getProducer()); + } if (versionProps.containsKey(WILDFLY_CLI_GA)) { gaToProducer.put(WILDFLY_CLI_GA, fp.getFPID().getProducer()); } @@ -389,6 +394,14 @@ public void postInstall(ProvisioningRuntime runtime) throws ProvisioningExceptio artifactResolver = this::resolveMaven; artifactInstaller = new SimpleArtifactInstaller(artifactResolver, generatedMavenRepo, artifactRecorder); + // Resolution of provisioning artifacts that we would need in the generated licenses. + MavenArtifact configGen = Utils.toArtifactCoords(mergedArtifactVersions, CONFIG_GEN_GA, + false, channelArtifactResolution, requireChannel(gaToProducer.get(CONFIG_GEN_GA))); + artifactResolver.resolve(configGen); + MavenArtifact plugin = Utils.toArtifactCoords(mergedArtifactVersions, GALLEON_PLUGINS_GA, + false, channelArtifactResolution, requireChannel(gaToProducer.get(GALLEON_PLUGINS_GA))); + artifactResolver.resolve(plugin); + final ProvisioningLayoutFactory layoutFactory = runtime.getLayout().getFactory(); pkgProgressTracker = layoutFactory.getProgressTracker(ProvisioningLayoutFactory.TRACK_PACKAGES); long pkgsTotal = 0;