diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index b7fab70..fd8a71d 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -159,7 +159,10 @@ jobs: - name: Create Homebrew Tap Formula Archive if: success() working-directory: build - run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-completion.sh sourcehawk*.1.gz + run: | + cp sourcehawk-completion.sh sourcehawk-bash-completion.sh + cp sourcehawk-completion.sh sourcehawk-zsh-completion.sh + gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-bash-completion.sh sourcehawk-zsh-completion.sh sourcehawk*.1.gz - name: Archive Mac Native Image if: success() continue-on-error: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d29d58..55d2ca7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,13 +15,10 @@ on: required: false default: 'false' jobs: - build: + build-java-8: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - outputs: - RELEASE_VERSION: ${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }} - RELEASE_ASSET_UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout Source Code uses: actions/checkout@v2 @@ -57,10 +54,13 @@ jobs: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }} - build-java11: + build-java-11: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + outputs: + RELEASE_VERSION: ${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }} + RELEASE_ASSET_UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout Source Code uses: actions/checkout@v2 @@ -71,6 +71,7 @@ jobs: with: java-version: 11 - name: Set Maven Project Version + id: set_maven_project_version shell: bash run: | RELEASE_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout | tail -1 | tr -d '\r\n') @@ -130,7 +131,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ format('v{0}', steps.set_maven_project_version.outputs.RELEASE_VERSION) }} - release_name: ${{ format('{0} {1}', github.event.repository.name, needs.build.outputs.RELEASE_VERSION) }} + release_name: ${{ format('{0} {1}', github.event.repository.name, steps.set_maven_project_version.outputs.RELEASE_VERSION) }} body_path: CHANGELOG.md draft: ${{ github.event.inputs.draft }} prerelease: ${{ github.event.inputs.prerelease }} @@ -139,7 +140,7 @@ jobs: continue-on-error: true uses: jamesives/github-pages-deploy-action@3.7.1 with: - COMMIT_MESSAGE: ${{ format('Publishing github pages for release version {0}', needs.build.outputs.RELEASE_VERSION) }} + COMMIT_MESSAGE: ${{ format('Publishing github pages for release version {0}', steps.set_maven_project_version.outputs.RELEASE_VERSION) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: gh-pages @@ -152,7 +153,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/linux/target/sourcehawk - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-linux-x86_64 + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-linux-x86_64 asset_content_type: application/octet-stream - name: Upload Sourcehawk Debian Buster Package if: success() @@ -163,7 +164,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/debian/target/sourcehawk-debian-buster.deb - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-debian-buster-amd64.deb + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-debian-buster-amd64.deb asset_content_type: application/octet-stream - name: Upload Sourcehawk Ubuntu Focal Package if: success() @@ -174,7 +175,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/debian/target/sourcehawk-ubuntu-focal.deb - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-ubuntu-focal-amd64.deb + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-ubuntu-focal-amd64.deb asset_content_type: application/octet-stream - name: Upload Sourcehawk Centos 7 RPM Package if: success() @@ -185,7 +186,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/rpm/target/sourcehawk-centos-7.rpm - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-1.el7.x86_64.rpm + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-1.el7.x86_64.rpm asset_content_type: application/octet-stream - name: Upload Sourcehawk Centos 8 RPM Package if: success() @@ -196,7 +197,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/rpm/target/sourcehawk-centos-8.rpm - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-1.el8.x86_64.rpm + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-1.el8.x86_64.rpm asset_content_type: application/octet-stream - name: Upload Sourcehawk Fedora 33 RPM Package if: success() @@ -207,7 +208,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/rpm/target/sourcehawk-fedora-33.rpm - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-1.fc33.x86_64.rpm + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-1.fc33.x86_64.rpm asset_content_type: application/octet-stream - name: Upload Sourcehawk Fedora 34 RPM Package if: success() @@ -218,7 +219,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/rpm/target/sourcehawk-fedora-34.rpm - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-1.fc34.x86_64.rpm + asset_name: sourcehawk-${{ steps.set_maven_project_version.outputs.RELEASE_VERSION }}-1.fc34.x86_64.rpm asset_content_type: application/octet-stream - name: Upload Sourcehawk Fedora 35 RPM Package if: success() @@ -229,11 +230,11 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./distributions/rpm/target/sourcehawk-fedora-35.rpm - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-1.fc35.x86_64.rpm + asset_name: sourcehawk-${{ needs.build-java-11.outputs.RELEASE_VERSION }}-1.fc35.x86_64.rpm asset_content_type: application/octet-stream build-mac-native-image: runs-on: macos-latest - needs: build-java11 + needs: build-java-11 steps: - name: Download Native Image JAR uses: actions/download-artifact@v2 @@ -275,7 +276,10 @@ jobs: - name: Create Homebrew Tap Formula Archive if: success() working-directory: build - run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-completion.sh sourcehawk*.1.gz + run: | + cp sourcehawk-completion.sh sourcehawk-bash-completion.sh + cp sourcehawk-completion.sh sourcehawk-zsh-completion.sh + gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-bash-completion.sh sourcehawk-zsh-completion.sh sourcehawk*.1.gz - name: Upload Sourcehawk Mac Executable if: success() continue-on-error: true @@ -283,9 +287,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.build.outputs.RELEASE_ASSET_UPLOAD_URL }} + upload_url: ${{ needs.build-java-11.outputs.RELEASE_ASSET_UPLOAD_URL }} asset_path: build/sourcehawk - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-darwin-x86_64 + asset_name: sourcehawk-${{ needs.build-java-11.outputs.RELEASE_VERSION }}-darwin-x86_64 asset_content_type: application/octet-stream - name: Upload Sourcehawk Mac Homebrew Tap Formula Archive id: upload_homebrew_tap_formula_archive @@ -295,28 +299,28 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.build.outputs.RELEASE_ASSET_UPLOAD_URL }} + upload_url: ${{ needs.build-java-11.outputs.RELEASE_ASSET_UPLOAD_URL }} asset_path: build/sourcehawk-homebrew-tap-formula.tar.gz - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-darwin-x86_64.tar.gz + asset_name: sourcehawk-${{ needs.build-java-11.outputs.RELEASE_VERSION }}-darwin-x86_64.tar.gz asset_content_type: application/octet-stream - name: Update Optum Homebrew Tap Formula uses: mislav/bump-homebrew-formula-action@v1.10 continue-on-error: true with: formula-name: sourcehawk - tag-name: ${{ needs.build.outputs.RELEASE_VERSION }} + tag-name: ${{ needs.build-java-11.outputs.RELEASE_VERSION }} homebrew-tap: optum/homebrew-tap base-branch: main download-url: ${{ steps.upload_homebrew_tap_formula_archive.outputs.browser_download_url }} commit-message: | - Sourcehawk ${{ needs.build.outputs.RELEASE_VERSION }} + Sourcehawk ${{ needs.build-java-11.outputs.RELEASE_VERSION }} Updating sourcehawk formula to latest release version env: COMMITTER_TOKEN: ${{ secrets.GIT_COMMITTER_TOKEN }} build-windows-native-image: runs-on: windows-latest - needs: build-java11 + needs: build-java-11 steps: - name: Download Native Image JAR uses: actions/download-artifact@v2 @@ -347,7 +351,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.build.outputs.RELEASE_ASSET_UPLOAD_URL }} + upload_url: ${{ needs.build-java-11.outputs.RELEASE_ASSET_UPLOAD_URL }} asset_path: sourcehawk.exe - asset_name: sourcehawk-${{ needs.build.outputs.RELEASE_VERSION }}-windows-x86_64.exe + asset_name: sourcehawk-${{ needs.build-java-11.outputs.RELEASE_VERSION }}-windows-x86_64.exe asset_content_type: application/octet-stream diff --git a/attribution.txt b/attribution.txt index fc3dc30..040240f 100644 --- a/attribution.txt +++ b/attribution.txt @@ -748,7 +748,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ------------------------------------------------------------------------------------------------------------------------------- -Package: org.slf4j:slf4j-simple:1.7.30 +Package: org.slf4j:slf4j-nop:1.7.32 License: MIT @@ -768,7 +768,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ------------------------------------------------------------------------------------------------------------------------------- -Package: org.slf4j:slf4j-api:1.7.30 +Package: org.slf4j:slf4j-simple:1.7.32 + +License: MIT + +Copyrights: + + +License Text: +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------------------------------------------------------- + +Package: org.slf4j:slf4j-api:1.7.32 License: MIT diff --git a/bom/pom.xml b/bom/pom.xml index febfdc6..3af5d5f 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT sourcehawk-bom diff --git a/cli/pom.xml b/cli/pom.xml index a73a1ea..4100d17 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -8,7 +8,7 @@ sourcehawk com.optum.sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT sourcehawk-cli diff --git a/core/pom.xml b/core/pom.xml index 0d73a61..57e9f5f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml @@ -19,9 +19,10 @@ - **/utils/ModifiableProperties.java - **/utils/ModifiableProperties.java - **/utils/ModifiableProperties.java + **/utils/ModifiableProperties.java + ${sca.exclusions} + ${sca.exclusions} + ${sca.exclusions} diff --git a/distributions/debian/pom.xml b/distributions/debian/pom.xml index 717f22a..cee146d 100644 --- a/distributions/debian/pom.xml +++ b/distributions/debian/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml @@ -19,7 +19,7 @@ ${project.build.directory}/debian - ${bintray.package} + ${global.project.name} ${project.version} amd64 @@ -85,7 +85,7 @@ - ${project.parent.parent.basedir}/gh-pages/manpages + ${maven.multiModuleProjectDirectory}/gh-pages/manpages ${debian.package}* diff --git a/distributions/docker/pom.xml b/distributions/docker/pom.xml index 2485517..7daa29e 100644 --- a/distributions/docker/pom.xml +++ b/distributions/docker/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/distributions/linux/pom.xml b/distributions/linux/pom.xml index b416378..66c15a3 100644 --- a/distributions/linux/pom.xml +++ b/distributions/linux/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/distributions/pom.xml b/distributions/pom.xml index 71a430b..1c47156 100644 --- a/distributions/pom.xml +++ b/distributions/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/distributions/rpm/pom.xml b/distributions/rpm/pom.xml index 6ae2df9..6708298 100644 --- a/distributions/rpm/pom.xml +++ b/distributions/rpm/pom.xml @@ -8,7 +8,7 @@ sourcehawk-dist com.optum.sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT sourcehawk-dist-rpm @@ -18,12 +18,11 @@ Sourcehawk RPM Packages - ${bintray.package} + ${global.project.name} ${project.version} x86_64 ${project.build.directory}/rpmbuild - @@ -106,7 +105,7 @@ - ${project.parent.parent.basedir}/gh-pages/manpages + ${maven.multiModuleProjectDirectory}/gh-pages/manpages ${rpm.package}* diff --git a/enforcer/core/pom.xml b/enforcer/core/pom.xml index fb9c5d6..236b66a 100644 --- a/enforcer/core/pom.xml +++ b/enforcer/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/aot/pom.xml b/enforcer/file/aot/pom.xml index 43086e6..0a656a6 100644 --- a/enforcer/file/aot/pom.xml +++ b/enforcer/file/aot/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/aot/src/test/groovy/com/optum/sourcehawk/enforcer/file/aot/SourcehawkFileEnforcerRegistryProcessorSpec.groovy b/enforcer/file/aot/src/test/groovy/com/optum/sourcehawk/enforcer/file/aot/SourcehawkFileEnforcerRegistryProcessorSpec.groovy index d657afd..d74f8b0 100644 --- a/enforcer/file/aot/src/test/groovy/com/optum/sourcehawk/enforcer/file/aot/SourcehawkFileEnforcerRegistryProcessorSpec.groovy +++ b/enforcer/file/aot/src/test/groovy/com/optum/sourcehawk/enforcer/file/aot/SourcehawkFileEnforcerRegistryProcessorSpec.groovy @@ -94,7 +94,8 @@ class SourcehawkFileEnforcerRegistryProcessorSpec extends Specification { Filer mockFiler = Mock() JavaFileObject mockJavaFileObject = Mock() FileObject mockFileObject = Mock() - FileObject mockResourceObject = Mock() + FileObject mockNativeImagePropertiesResourceObject = Mock() + FileObject mockReflectConfigJsonResourceObject = Mock() Writer javaFileWriter = new StringWriter() Writer reflectConfigJsonResourceWriter = new StringWriter() @@ -113,8 +114,8 @@ class SourcehawkFileEnforcerRegistryProcessorSpec extends Specification { 1 * mockJavaFileObject.openWriter() >> javaFileWriter 1 * mockFiler.getResource(StandardLocation.CLASS_PATH, "", "reflect-config-template.json") >> mockFileObject 1 * mockFileObject.getCharContent(false) >> IoUtil.getResourceAsStream("/reflect-config-template.json").text - 1 * mockFiler.createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/native-image/sourcehawk-generated/sourcehawk-enforcer-file/reflect-config.json") >> mockResourceObject - 1 * mockResourceObject.openWriter() >> reflectConfigJsonResourceWriter + 1 * mockFiler.createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/native-image/sourcehawk-generated/sourcehawk-enforcer-file/reflect-config.json") >> mockReflectConfigJsonResourceObject + 1 * mockReflectConfigJsonResourceObject.openWriter() >> reflectConfigJsonResourceWriter 0 * _ and: diff --git a/enforcer/file/aot/src/test/resources/native-image.properties.txt b/enforcer/file/aot/src/test/resources/native-image.properties.txt new file mode 100644 index 0000000..a7406e1 --- /dev/null +++ b/enforcer/file/aot/src/test/resources/native-image.properties.txt @@ -0,0 +1,3 @@ +Args = \ + --initialize-at-build-time=com.optum.sourcehawk.enforcer.file.ConcreteTestFileEnforcer,com.optum.sourcehawk.enforcer.file.ConcreteTestFileEnforcer$Builder \ + --initialize-at-build-time=com.optum.sourcehawk.enforcer.file.Concrete2TestFileEnforcer,com.optum.sourcehawk.enforcer.file.Concrete2TestFileEnforcer$Builder \ No newline at end of file diff --git a/enforcer/file/common/pom.xml b/enforcer/file/common/pom.xml index 8604ff5..c2efef8 100644 --- a/enforcer/file/common/pom.xml +++ b/enforcer/file/common/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEquals.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEquals.java index 81b01c5..05cda82 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEquals.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEquals.java @@ -3,10 +3,12 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import com.optum.sourcehawk.enforcer.EnforcerResult; import com.optum.sourcehawk.enforcer.file.AbstractFileEnforcer; import com.optum.sourcehawk.enforcer.file.json.JsonValueEquals; +import com.optum.sourcehawk.enforcer.file.xml.XPathEquals; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.NonNull; @@ -28,12 +30,12 @@ * @author Brian Wyka */ @Builder(builderClassName = "Builder") -@JsonDeserialize(builder = YamlValueEquals.Builder.class) +@JsonDeserialize(builder = XPathEquals.Builder.class) @AllArgsConstructor(staticName = "equals") public class YamlValueEquals extends AbstractFileEnforcer { - private static final ObjectMapper YAML_MAPPER = new YAMLMapper(); - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final ObjectMapper YAML_MAPPER = YAMLMapper.builder().build(); + private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder().build(); /** * Key: The Yaml Pointer expression to retrieve the value diff --git a/enforcer/file/core/pom.xml b/enforcer/file/core/pom.xml index 96c8013..d2e57c5 100644 --- a/enforcer/file/core/pom.xml +++ b/enforcer/file/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/docker/pom.xml b/enforcer/file/docker/pom.xml index 6ec6ae9..6ba7e6c 100644 --- a/enforcer/file/docker/pom.xml +++ b/enforcer/file/docker/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/maven/pom.xml b/enforcer/file/maven/pom.xml index 76dd2ef..6869116 100644 --- a/enforcer/file/maven/pom.xml +++ b/enforcer/file/maven/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/pom.xml b/enforcer/file/pom.xml index bbb6251..262e3ad 100644 --- a/enforcer/file/pom.xml +++ b/enforcer/file/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/file/registry/pom.xml b/enforcer/file/registry/pom.xml index 88c405e..e86b29c 100644 --- a/enforcer/file/registry/pom.xml +++ b/enforcer/file/registry/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/enforcer/pom.xml b/enforcer/pom.xml index ee974cc..ddafca8 100644 --- a/enforcer/pom.xml +++ b/enforcer/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/exec/pom.xml b/exec/pom.xml index a7bc559..e251537 100644 --- a/exec/pom.xml +++ b/exec/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT ../pom.xml diff --git a/exec/src/main/java/com/optum/sourcehawk/exec/ConfigurationReader.java b/exec/src/main/java/com/optum/sourcehawk/exec/ConfigurationReader.java index 747d76e..04d1be8 100644 --- a/exec/src/main/java/com/optum/sourcehawk/exec/ConfigurationReader.java +++ b/exec/src/main/java/com/optum/sourcehawk/exec/ConfigurationReader.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import com.fasterxml.jackson.databind.introspect.AnnotatedClass; import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; @@ -44,15 +44,16 @@ public class ConfigurationReader { /** * The object mapper which is used to deserialize the configuration from file */ - public final ObjectMapper MAPPER = new YAMLMapper() - .setSerializationInclusion(JsonInclude.Include.NON_NULL) - .setPropertyNamingStrategy(new PropertyNamingStrategy.KebabCaseStrategy()) - .setAnnotationIntrospector(new JacksonAnnotationIntrospector() { - @Override - public JsonPOJOBuilder.Value findPOJOBuilderConfig(final AnnotatedClass annotatedClass) { - return new JsonPOJOBuilder.Value("build", ""); - } - }); + public final ObjectMapper MAPPER = YAMLMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE) + .annotationIntrospector(new JacksonAnnotationIntrospector() { + @Override + public JsonPOJOBuilder.Value findPOJOBuilderConfig(final AnnotatedClass annotatedClass) { + return new JsonPOJOBuilder.Value("build", ""); + } + }) + .build(); /** * Parse the configuration from the provided yaml string diff --git a/exec/src/main/resources/META-INF/native-image/sourcehawk-exec/native-image.properties b/exec/src/main/resources/META-INF/native-image/sourcehawk-exec/native-image.properties index f9c461d..dd1ffee 100644 --- a/exec/src/main/resources/META-INF/native-image/sourcehawk-exec/native-image.properties +++ b/exec/src/main/resources/META-INF/native-image/sourcehawk-exec/native-image.properties @@ -1,4 +1,5 @@ Args = --enable-url-protocols=http,https \ + --initialize-at-build-time=com.optum.sourcehawk.enforcer.file \ --initialize-at-build-time=com.fasterxml.jackson,org.yaml.snakeyaml \ --initialize-at-build-time=javax,jdk.xml.internal \ --initialize-at-build-time=com.sun.xml.internal.stream.util,com.sun.xml.internal.stream.XMLEntityStorage \ diff --git a/exec/src/test/groovy/com/optum/sourcehawk/exec/NativeImageConfigSpec.groovy b/exec/src/test/groovy/com/optum/sourcehawk/exec/NativeImageConfigSpec.groovy index cb4027f..2d17cfd 100644 --- a/exec/src/test/groovy/com/optum/sourcehawk/exec/NativeImageConfigSpec.groovy +++ b/exec/src/test/groovy/com/optum/sourcehawk/exec/NativeImageConfigSpec.groovy @@ -21,6 +21,7 @@ class NativeImageConfigSpec extends Specification { then: args.contains("--enable-url-protocols=http,https") + args.contains("--initialize-at-build-time=com.optum.sourcehawk.enforcer.file") args.contains("--initialize-at-build-time=com.fasterxml.jackson,org.yaml.snakeyaml") args.contains("--initialize-at-build-time=javax,jdk.xml.internal") args.contains("--initialize-at-build-time=com.sun.xml.internal.stream.util,com.sun.xml.internal.stream.XMLEntityStorage") diff --git a/pom.xml b/pom.xml index 39b2b17..1c614e2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,12 +6,12 @@ com.optum.sourcehawk sourcehawk-jar-parent - 1.2.0 + 1.3.0 sourcehawk - 0.7.0-SNAPSHOT + 0.7.1-SNAPSHOT pom Sourcehawk @@ -90,18 +90,18 @@ org.slf4j - slf4j-nop + slf4j-simple ${slf4j.version} org.slf4j - slf4j-simple + slf4j-nop ${slf4j.version} com.fasterxml.jackson jackson-bom - 2.11.4 + 2.12.5 import pom