Skip to content

Commit

Permalink
Introduce quarkus-core-compatibility extension metadata
Browse files Browse the repository at this point in the history
This introduces a `quarkus-core-compatibility` metadata in the extension YAML descriptor. It should serve as an indicator for core compatibilty for a given Quarkus version.
The format is `[major.minor,)`.
  • Loading branch information
gastaldi committed Jul 15, 2024
1 parent d7b84f6 commit 59e3514
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.atomic.AtomicReference;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Scm;
import org.apache.maven.plugin.AbstractMojo;
Expand Down Expand Up @@ -620,6 +621,11 @@ private void setBuiltWithQuarkusCoreVersion(ObjectNode extObject) throws MojoExe
if (coreVersionLocator.coreVersion != null) {
ObjectNode metadata = getMetadataNode(extObject);
metadata.put("built-with-quarkus-core", coreVersionLocator.coreVersion);
if (!metadata.has("quarkus-core-compatibility")) {
DefaultArtifactVersion dav = new DefaultArtifactVersion(coreVersionLocator.coreVersion);
String compatibilityRange = "[" + dav.getMajorVersion() + "." + dav.getMinorVersion() + ",)";
metadata.put("quarkus-core-compatibility", compatibilityRange);
}
} else if (!ignoreNotDetectedQuarkusCoreVersion) {
throw new MojoExecutionException("Failed to determine the Quarkus core version used to build the extension");
}
Expand Down

0 comments on commit 59e3514

Please sign in to comment.