From 4729a0bdd00dbdf3c1f1d5906a7ac0bef315d10c Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Mon, 27 May 2024 14:52:50 -0400 Subject: [PATCH] Adjusted POM metadata and deployment settings to allow for artifact deployment as GitHub packages. --- .github/workflows/build.yml | 45 +++++-- cli-processor/pom.xml | 17 ++- core/pom.xml | 6 +- databind-metaschema/pom.xml | 8 +- databind/pom.xml | 6 +- metaschema-cli/pom.xml | 6 +- metaschema-documentation-generator/pom.xml | 6 +- metaschema-freemarker-support/pom.xml | 6 +- metaschema-maven-plugin/pom.xml | 6 +- .../src/it/generate-sources/pom.xml | 2 +- metaschema-testing/pom.xml | 7 +- pom.xml | 127 +++++++++++------- schemagen/pom.xml | 6 +- 13 files changed, 155 insertions(+), 93 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fceb61c9d..be7894167 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,10 +23,12 @@ jobs: actions: read contents: read security-events: write + packages: write env: # BUILD_SNAPSHOT: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && # (github.ref_name == 'develop' || startsWith(github.ref_name, 'release-')) }} - BUILD_SNAPSHOT: false + BUILD_SNAPSHOT: true + DEPLOY_MAVEN_CENTRAL: false steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 with: @@ -47,11 +49,8 @@ jobs: java-version: 11 distribution: 'temurin' cache: 'maven' - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + # gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import + # gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - name: Set up JDK 11 (build only) if: ${{ steps.setup-java-deploy.outcome == 'skipped' }} uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 @@ -67,17 +66,17 @@ jobs: # ------------------------- # Maven Build # ------------------------- - - id: build-test-deploy + - id: build-test-deploy-github name: Build, Test and DEPLOY SNAPSHOT Code if: ${{ env.BUILD_SNAPSHOT == 'true' }} run: | - mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases + # mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases + mvn -B -e -Prelease -Preporting deploy -Dmaven.deploy.skip=releases env: - MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Build and Test Code - if: ${{ steps.build-test-deploy.outcome == 'skipped' }} + if: ${{ steps.build-test-deploy-github.outcome == 'skipped' }} run: | mvn -B -e -Prelease -Preporting install - name: Perform CodeQL Analysis @@ -89,3 +88,25 @@ jobs: run: | # this needs to be run as a second build to ensure source is fully generated by the previous step mvn -B -e -Prelease -Preporting install site site:stage + - id: setup-java-deploy-maven-central + name: Set up JDK 11 (deploy) + if: ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }} + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 + with: + java-version: 11 + distribution: 'temurin' + cache: 'maven' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - id: build-test-deploy-maven-central + name: Build, Test and DEPLOY SNAPSHOT Code + if: ${{ env.BUILD_SNAPSHOT == 'true' && env.DEPLOY_MAVEN_CENTRAL == 'true' }} + run: | + mvn -B -e -Pgpg -Prelease -Preporting deploy -Dmaven.deploy.skip=releases + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/cli-processor/pom.xml b/cli-processor/pom.xml index 736202841..1105e455f 100644 --- a/cli-processor/pom.xml +++ b/cli-processor/pom.xml @@ -1,8 +1,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -10,7 +10,16 @@ jar Metaschema CLI Framework - http://maven.apache.org + + ${site.url}${project.artifactId}/ + + + website + ${site.url}${project.artifactId}/ + + + + Provides command line interface (CLI) functionality used to provide CLI-based tools. ${maven.build.timestamp} @@ -19,7 +28,7 @@ - gov.nist.secauto.metaschema + ${project.groupId} metaschema-core diff --git a/core/pom.xml b/core/pom.xml index e4fabc367..ee1e70421 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -16,7 +16,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/databind-metaschema/pom.xml b/databind-metaschema/pom.xml index fe954bf62..3ace9bc3c 100644 --- a/databind-metaschema/pom.xml +++ b/databind-metaschema/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -14,7 +14,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ @@ -79,7 +79,7 @@ - gov.nist.secauto.metaschema + ${project.groupId} metaschema-maven-plugin ${project.version} diff --git a/databind/pom.xml b/databind/pom.xml index 0e64f3e69..bd2bb23e2 100644 --- a/databind/pom.xml +++ b/databind/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -17,7 +17,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/metaschema-cli/pom.xml b/metaschema-cli/pom.xml index d3d538961..26d96e5d4 100644 --- a/metaschema-cli/pom.xml +++ b/metaschema-cli/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -14,7 +14,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/metaschema-documentation-generator/pom.xml b/metaschema-documentation-generator/pom.xml index 238f24d43..42c65586d 100644 --- a/metaschema-documentation-generator/pom.xml +++ b/metaschema-documentation-generator/pom.xml @@ -1,8 +1,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-SNAPSHOT metaschema-documentation-generator @@ -12,7 +12,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/metaschema-freemarker-support/pom.xml b/metaschema-freemarker-support/pom.xml index 9a3031ba3..5de5d9f13 100644 --- a/metaschema-freemarker-support/pom.xml +++ b/metaschema-freemarker-support/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-SNAPSHOT @@ -16,7 +16,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/metaschema-maven-plugin/pom.xml b/metaschema-maven-plugin/pom.xml index 3fde0af51..f64320967 100644 --- a/metaschema-maven-plugin/pom.xml +++ b/metaschema-maven-plugin/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT @@ -18,7 +18,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/metaschema-maven-plugin/src/it/generate-sources/pom.xml b/metaschema-maven-plugin/src/it/generate-sources/pom.xml index a2b607d30..04bec67a4 100644 --- a/metaschema-maven-plugin/src/it/generate-sources/pom.xml +++ b/metaschema-maven-plugin/src/it/generate-sources/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - gov.nist.secauto.metaschema.it + @project.groupId@.it generate-sources-test @project.version@ diff --git a/metaschema-testing/pom.xml b/metaschema-testing/pom.xml index 46365525e..9e2f698b4 100644 --- a/metaschema-testing/pom.xml +++ b/metaschema-testing/pom.xml @@ -1,18 +1,17 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT metaschema-testing Metaschema Unit Testing Support - ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/ diff --git a/pom.xml b/pom.xml index 2d9f57245..c52415c8d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,86 +8,70 @@ oss-parent 28-SNAPSHOT - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT pom - Metaschema Framework Parent - A common build root for all NIST Java projects related to the - Metaschema framework. + Metaschema Framework Java Implementation Parent + A collection of Java projects supporting use of the Metaschema Framework for information modeling and working with Metaschema module-based data. This project was started at the National Institute of Standards and Technology. In the time since, this project has evolved into an open source, implementation-driven effort contributed to and used by many organizations. ${site.url} - https://github.com/usnistgov/metaschema-java/issues + https://github.com/metaschema-framework/metaschema-java/issues GitHub Issues - https://github.com/usnistgov/metaschema-java/tree/main - scm:git:git@github.com/usnistgov/metaschema-java.git + https://github.com/metaschema-framework/metaschema-java/tree/main + + scm:git:git@github.com/metaschema-framework/metaschema-java.git - scm:git:git@github.com:usnistgov/metaschema-java.git + scm:git:git@github.com:metaschema-framework/metaschema-java.git v0.12.0 - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - nist-pages + + website ${site.url} - NIST License - https://www.nist.gov/director/licensing + The CC0 Public Domain Dedication + https://creativecommons.org/publicdomain/zero/1.0/legalcode repo - NIST software License + This project continues to provide open source under the CC0 license originally used by NIST for previous revisions of this project. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. - National Institute of Standards and Technology - https://www.nist.gov + metaschema.dev + https://metaschema.dev - david.waltermire@nist.gov + davewaltermire@gmail.com David Waltermire - david.waltermire@nist.gov - National Institute of Standards and Technology + davewaltermire@gmail.com + metaschema.dev architect developer maintainer + + david.waltermire@nist.gov + David Waltermire + National Institute of Standards and Technology + + creator + + - - - OSCAL NIST Team - oscal@nist.gov - - - OSCAL Project Development Discussion - oscal-dev@nist.gov - oscal-dev-join@nist.gov - oscal-dev-leave@nist.gov - - - OSCAL Project Updates - oscal-updates-join@nist.gov - oscal-updates-leave@nist.gov - - - https://pages.nist.gov/metaschema-java/ - https://github.com/usnistgov/metaschema-java - https://github.com/usnistgov/metaschema-java/issues + https://metaschema-java.metaschema.dev/ + https://github.com/david-waltermire/metaschema-java + + https://github.com/david-waltermire/metaschema-java/issues @@ -793,4 +777,53 @@ + + + github + + + !deployOSSRH + + + + + github + GitHub Packages + + https://maven.pkg.github.com/david-waltermire/metaschema-java + + + github + GitHub Packages + + https://maven.pkg.github.com/david-waltermire/metaschema-java + + + + + ossrh + + + deployOSSRH + true + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + website + ${site.url} + + + + + \ No newline at end of file diff --git a/schemagen/pom.xml b/schemagen/pom.xml index 7d99ea6a0..596d80a4d 100644 --- a/schemagen/pom.xml +++ b/schemagen/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - gov.nist.secauto.metaschema - metaschema-framework + dev.metaschema + metaschema-java-parent 1.0.0-M2-SNAPSHOT metaschema-schema-generator @@ -11,7 +11,7 @@ ${site.url}${project.artifactId}/ - nist-pages + website ${site.url}${project.artifactId}/