diff --git a/pom.xml b/pom.xml index 387c96b..d9788ac 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 gov.nist.secauto @@ -109,17 +111,23 @@ 1.1.1 - 1.5.0 - 2.15.1 + 1.7.0 + 2.16.1 1.14.4 + 2.4.1 3.21.0 - 20231013 - 2.21.0 - 4.7.3 + 20240303 + 2.23.1 + 7.1.0 + 4.8.3 12.4 - 6.0.2 + 5.2.0 + 5.2.2 4.2 + 3.1.0 + 3.22.0 + 4.8.4.0 @@ -193,7 +201,11 @@ org.fusesource.jansi jansi +<<<<<<< HEAD 2.4.1 +======= + ${dependency.jansi.version} +>>>>>>> 549a44e (Fixed PMD errors) commons-io @@ -216,6 +228,11 @@ data ${dependency.xmlresolver.version} + + org.apache.xmlbeans + xmlbeans + ${dependency.xmlbeans.version} + com.github.erosb everit-json-schema @@ -262,6 +279,27 @@ + + org.apache.maven.plugins + maven-toolchains-plugin + ${plugin.maven-toolchains.version} + + + + toolchain + + + + + + + 11 + temurin + + + + + org.apache.maven.plugins maven-site-plugin @@ -284,13 +322,50 @@ com.github.spotbugs spotbugs-maven-plugin + ${plugin.spotbugs.version} spotbugs-exclude.xml + + org.apache.maven.plugins + maven-pmd-plugin + ${plugin.pmd.version} + + + net.sourceforge.pmd + pmd-core + ${dependency.pmd.version} + + + net.sourceforge.pmd + pmd-java + ${dependency.pmd.version} + + + + + pmd-verify + + check + + + 2 + + true + true + sarif + + + + + + org.apache.maven.plugins + maven-toolchains-plugin + io.github.git-commit-id git-commit-id-maven-plugin @@ -324,7 +399,8 @@ true custom - ${artifact.groupId}.${artifact.artifactId}-$${artifact.version}.${artifact.extension} + + ${artifact.groupId}.${artifact.artifactId}-$${artifact.version}.${artifact.extension} @@ -343,8 +419,10 @@ false flat lib - @{groupId}@.@{artifactId}@-@{version}@.@{extension}@ - -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 + + @{groupId}@.@{artifactId}@-@{version}@.@{extension}@ + -Dsun.stdout.encoding=UTF-8 + -Dsun.stderr.encoding=UTF-8 true false @@ -422,10 +500,13 @@ add-third-party - ${project.build.directory}/generated-distro + + ${project.build.directory}/generated-distro LICENSE-THIRD-PARTY.txt - The Apache Software License, Version 2.0|Apache License, Version 2.0|Apache Public License 2.0 + The Apache Software License, + Version 2.0|Apache License, Version + 2.0|Apache Public License 2.0 diff --git a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalConvertSubcommand.java b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalConvertSubcommand.java index 78f6876..43b9f38 100644 --- a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalConvertSubcommand.java +++ b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalConvertSubcommand.java @@ -47,7 +47,7 @@ public ICommandExecutor newExecutor(CallingContext callingContext, CommandLine c return new OscalCommandExecutor(callingContext, commandLine); } - private class OscalCommandExecutor + private final class OscalCommandExecutor extends AbstractConversionCommandExecutor { private OscalCommandExecutor( diff --git a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalValidationSubcommand.java b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalValidationSubcommand.java index 0db1fa6..ebc5c21 100644 --- a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalValidationSubcommand.java +++ b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/oscal/AbstractOscalValidationSubcommand.java @@ -60,7 +60,7 @@ public ICommandExecutor newExecutor(CallingContext callingContext, CommandLine c return new OscalCommandExecutor(callingContext, commandLine); } - private class OscalCommandExecutor + private final class OscalCommandExecutor extends AbstractValidationCommandExecutor { private OscalCommandExecutor( diff --git a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/profile/ResolveSubcommand.java b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/profile/ResolveSubcommand.java index d3e9488..3c682b6 100644 --- a/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/profile/ResolveSubcommand.java +++ b/src/main/java/gov/nist/secauto/oscal/tools/cli/core/commands/profile/ResolveSubcommand.java @@ -281,10 +281,11 @@ protected ExitStatus executeCommand( // this is a profile URI sourceUri = ObjectUtils.notNull(source.toUri()); - DynamicContext dynamicContext = StaticContext.builder() - .baseUri(sourceUri) - .build() - .dynamicContext(); + DynamicContext dynamicContext = new DynamicContext( + StaticContext.builder() + .baseUri(sourceUri) + .defaultModelNamespace(document.getNamespace()) + .build()); dynamicContext.setDocumentLoader(loader); ProfileResolver resolver = new ProfileResolver(); resolver.setDynamicContext(dynamicContext); @@ -308,7 +309,7 @@ protected ExitStatus executeCommand( = OscalBindingContext.instance().newSerializer(toFormat, Catalog.class); try { if (destination == null) { - @SuppressWarnings("resource") PrintStream stdOut = ObjectUtils.notNull(System.out); + @SuppressWarnings({ "resource", "PMD.CloseResource" }) PrintStream stdOut = ObjectUtils.notNull(System.out); serializer.serialize((Catalog) INodeItem.toValue(resolvedProfile), stdOut); } else { serializer.serialize((Catalog) INodeItem.toValue(resolvedProfile), destination);