From 727f611c9dcaa918a13c64a1a2d44cdb594e105d Mon Sep 17 00:00:00 2001 From: Bartosz Spyrko-Smietanko Date: Fri, 1 Nov 2024 10:28:53 +0000 Subject: [PATCH] [#18] Support logicalVersion in create/edit manifest mojos --- .../org/wildfly/channelplugin/CreateManifestMojo.java | 9 ++++++++- .../java/org/wildfly/channelplugin/EditManifestMojo.java | 7 +++++++ pom.xml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/org/wildfly/channelplugin/CreateManifestMojo.java b/plugin/src/main/java/org/wildfly/channelplugin/CreateManifestMojo.java index e455bf6..72fb441 100644 --- a/plugin/src/main/java/org/wildfly/channelplugin/CreateManifestMojo.java +++ b/plugin/src/main/java/org/wildfly/channelplugin/CreateManifestMojo.java @@ -20,6 +20,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.TreeSet; @@ -62,6 +63,12 @@ public class CreateManifestMojo extends AbstractMojo { @Parameter(name="manifestDescription", property = "manifestDescription") private String manifestDescription; + /** + * Optional logicalVersion of the generated manifest. + */ + @Parameter(name="manifestLogicalVersion", property = "manifestLogicalVersion") + private String manifestLogicalVersion; + @Inject private MavenProject project; @@ -125,7 +132,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { } - final ChannelManifest channelManifest = new ChannelManifest(manifestName, manifestId, manifestDescription, streams); + final ChannelManifest channelManifest = new ChannelManifest(manifestName, manifestId, manifestLogicalVersion, manifestDescription, Collections.emptyList(), streams); try { final String yaml = ChannelManifestMapper.toYaml(channelManifest); diff --git a/plugin/src/main/java/org/wildfly/channelplugin/EditManifestMojo.java b/plugin/src/main/java/org/wildfly/channelplugin/EditManifestMojo.java index bf8a160..aad0f7b 100644 --- a/plugin/src/main/java/org/wildfly/channelplugin/EditManifestMojo.java +++ b/plugin/src/main/java/org/wildfly/channelplugin/EditManifestMojo.java @@ -53,6 +53,12 @@ public class EditManifestMojo extends AbstractMojo { @Parameter(name="manifestRequirements") private List manifestRequirements; + /** + * Optional logicalVersion of the generated manifest. + */ + @Parameter(name="manifestLogicalVersion") + private String manifestLogicalVersion; + @Override public void execute() throws MojoExecutionException { final Path streamsManifestFile = Path.of(manifestPath); @@ -88,6 +94,7 @@ public void execute() throws MojoExecutionException { final ChannelManifest combinedManifest = new ChannelManifest(source.getSchemaVersion(), manifestName, manifestId, + manifestLogicalVersion, manifestDescription, requirements, source.getStreams()); diff --git a/pom.xml b/pom.xml index 7259dc9..2783229 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ 3.6.3 1.6.2 4.7 - 1.1.0.Final + 1.2.1.Final 5.7.2 3.22.0 0.13.1