From 576da929949e869dacda836a84d147d9b79bdfb5 Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Mon, 15 May 2023 09:59:45 -0700 Subject: [PATCH 1/4] update snakeyaml to 2.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fa3a57b3..c3dc1550 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ buildConfig = "3.0.3" owasp = "7.1.0.1" jacksonDatabind = "2.14.2" picocli = "4.6.3" -snakeYaml = "1.33" +snakeYaml = "2.0" #used for authz lib integration rundeck = "4.2.0-20220509" testcontainers = "1.17.2" From 3b22df068dab13eace54afe7ca9fbcd273eab105 Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Mon, 15 May 2023 10:00:05 -0700 Subject: [PATCH 2/4] update dep verification metadata --- gradle/verification-metadata.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index c124d053..3be722f7 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -32,6 +32,7 @@ + @@ -4493,6 +4494,14 @@ + + + + + + + + From f3977e2e1ba594e61db5431c1285d40264847f95 Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Mon, 15 May 2023 10:00:23 -0700 Subject: [PATCH 3/4] update snakeyaml usage for 2.0 --- rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java | 2 +- .../org/rundeck/client/tool/commands/projects/Configure.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java b/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java index ede396d0..8011c03c 100644 --- a/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java +++ b/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java @@ -285,7 +285,7 @@ private static void configYamlFormat(final RdBuilder belt, final RdClientConfig DumperOptions.FlowStyle.FLOW ); dumperOptions.setPrettyFlow(config.getBool("RD_YAML_PRETTY", true)); - Representer representer = new Representer(); + Representer representer = new Representer(dumperOptions); representer.addClassTag(JobItem.class, Tag.MAP); representer.addClassTag(ScheduledJobItem.class, Tag.MAP); representer.addClassTag(DateInfo.class, Tag.MAP); diff --git a/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java b/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java index bdf86954..8162c572 100644 --- a/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java +++ b/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java @@ -27,6 +27,7 @@ import org.rundeck.client.tool.options.ProjectNameOptions; import org.rundeck.client.tool.options.ProjectRequiredNameOptions; import org.rundeck.client.tool.options.UnparsedConfigOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import picocli.CommandLine; @@ -157,7 +158,7 @@ public static Map loadConfig(final ConfigFileOptions opts, inputConfig.putAll(map); break; case yaml: - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); try (FileInputStream fis = new FileInputStream(input)) { Object load = yaml.load(fis); if (load instanceof Map) { From e327b556542dc2f8d311ab197cf680439d4d02c1 Mon Sep 17 00:00:00 2001 From: ronaveva Date: Wed, 14 Jun 2023 16:45:14 -0400 Subject: [PATCH 4/4] mode add-opens to setCLassPath since it wasn't executing on a separated block --- rd-cli-tool/build.gradle | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rd-cli-tool/build.gradle b/rd-cli-tool/build.gradle index ba144671..2ed48321 100644 --- a/rd-cli-tool/build.gradle +++ b/rd-cli-tool/build.gradle @@ -105,13 +105,8 @@ set -e RD_CONF=${RD_CONF:-$HOME/.$APP_NAME/$APP_NAME.conf} test -f $RD_CONF && . $RD_CONF export RD_EXT_DIR=${RD_EXT_DIR:-$HOME/.$APP_NAME/extv2} -''' - ) - def setJ11AddOpens=appendConfigData.curry( - '^APP_ARGS=.*$', - ''' -if $JAVACMD --add-opens 2>&1 | grep 'requires modules' >/dev/null; then - JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" +if [ ! -z "$(java --add-opens 2>&1 | grep 'requires modules')" ]; then + export JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" fi ''' ) @@ -126,7 +121,6 @@ fi .readLines() .collect(setE) .collect(setClasspath) - .collect(setJ11AddOpens) .join('\n') }