Skip to content

Commit

Permalink
Resolve plugins and config-gen before packages resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Oct 25, 2023
1 parent 9106ea7 commit ceca800
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ceca800

Please sign in to comment.