Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use camel.version property value for catalog camelVersion metadata #6774

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public class PrepareCatalogQuarkusMojo extends AbstractExtensionListMojo {
@Parameter(property = "quarkus.version", required = true)
String quarkusVersion;

/**
* Camel version the current source tree depends on.
*/
@Parameter(property = "camel.version", required = true)
String camelVersion;

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
final Path catalogPath = catalogBaseDir.toPath().resolve(CqCatalog.CQ_CATALOG_DIR);
Expand Down Expand Up @@ -154,12 +160,12 @@ public void execute() throws MojoExecutionException, MojoFailureException {
"description is missing in " + ext.getRuntimePomXmlPath())));
model.setDeprecated(CqUtils.isDeprecated(title, models, ext.isDeprecated()));
model.setLabel(ext.getLabel().orElse("quarkus"));
update(model, ext, nativeSupported, quarkusVersion);
update(model, ext, nativeSupported, quarkusVersion, camelVersion);
CqCatalog.serialize(catalogPath, model);
schemesByKind.get(model.getKind().name()).add(model.getName());
} else {
for (ArtifactModel<?> model : models) {
update(model, ext, nativeSupported, quarkusVersion);
update(model, ext, nativeSupported, quarkusVersion, camelVersion);
CqCatalog.serialize(catalogPath, model);
schemesByKind.get(model.getKind().name()).add(model.getName());
}
Expand All @@ -182,15 +188,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}

private static void update(ArtifactModel<?> model, CamelQuarkusExtension ext, boolean nativeSupported,
String quarkusVersion) {
String quarkusVersion, String camelVersion) {
final String firstVersion = ext.getJvmSince()
.orElseThrow(() -> new RuntimeException(
"firstVersion property is missing in " + ext.getRuntimePomXmlPath()));
final Map<String, Object> metadata = model.getMetadata();
metadata.put(QUARKUS_VERSION, quarkusVersion);
if (model.getArtifactId() != null && model.getGroupId() != null) {
metadata.putIfAbsent(CAMEL_ARTIFACT, model.getGroupId() + ":" + model.getArtifactId());
metadata.putIfAbsent(CAMEL_VERSION, model.getVersion());
metadata.put(CAMEL_VERSION, camelVersion);
}
// lets use the camel-quarkus version as first version instead of Apache Camel
// version
Expand Down