From 1ad91bbdaf4d2a23e897b6acba43fcc79b2a2a3d Mon Sep 17 00:00:00 2001 From: jschwarz Date: Thu, 1 Aug 2024 12:13:20 +0200 Subject: [PATCH] activate tests --- .github/workflows/release.yaml | 3 +- pom.xml | 40 ++++++++++++++++++- src/it/modules/pom.xml | 2 +- src/it/modules/verify.groovy | 5 +-- .../java/de/eitco/cicd/bom/xml/Developer.java | 14 +++---- .../java/de/eitco/cicd/bom/xml/License.java | 8 ++-- .../de/eitco/cicd/bom/xml/Organization.java | 4 +- src/main/java/de/eitco/cicd/bom/xml/Scm.java | 8 ++-- 8 files changed, 60 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2692e8a..d949166 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,10 +7,11 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: eitco/maven-release@0.0.1 + - uses: eitco/maven-release@0.0.2 with: gpg-private-key: ${{ secrets.ARTIFACT_SIGNING_GPG_PRIVATE_KEY }} gpg-key-name: ${{ secrets.ARTIFACT_SIGNING_GPG_KEY_NAME }} gpg-passphrase: ${{ secrets.ARTIFACT_SIGNING_GPG_PRIVATE_KEY_PASSWORD }} deploy-user: ${{ secrets.OSSRH_JIRA_USERNAME }} deploy-password: ${{ secrets.OSSRH_JIRA_PASSWORD }} + git-ssh-private-key: ${{ secrets.SSH_KEY_EITCO_GITHUB }} diff --git a/pom.xml b/pom.xml index 5cbef0d..c1fdef0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.eitco.cicd eitco-oss-parent - 0.0.14 + 0.0.15 @@ -66,6 +66,8 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml + 2.16.1 + org.apache.maven.plugins @@ -83,15 +85,51 @@ maven-release-plugin + + deploy site site:stage scm-publish:publish-scm + maven-resources-plugin + + org.jacoco + jacoco-maven-plugin + + + maven-invoker-plugin + org.codehaus.mojo license-maven-plugin + + org.apache.maven.plugins + maven-site-plugin + + + org.apache.maven.plugins + maven-scm-publish-plugin + + + true + + + org.apache.maven.plugins + maven-plugin-report-plugin + + + + + + + github + scm:git:https://github.com/eitco/eitco.github.io.git + + + + \ No newline at end of file diff --git a/src/it/modules/pom.xml b/src/it/modules/pom.xml index df51fb9..1c64286 100644 --- a/src/it/modules/pom.xml +++ b/src/it/modules/pom.xml @@ -52,7 +52,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.3.0 + 1.5.0 false diff --git a/src/it/modules/verify.groovy b/src/it/modules/verify.groovy index 3912ec7..ff353a6 100644 --- a/src/it/modules/verify.groovy +++ b/src/it/modules/verify.groovy @@ -1,7 +1,4 @@ - -File deployDirectory = new File(basedir, "target/repository/de/eitco/bom/test/cicd-bom-test-bom") - -assert deployDirectory.isDirectory() +import groovy.xml.XmlSlurper File createdFile = new File(basedir, "target/bom.xml"); diff --git a/src/main/java/de/eitco/cicd/bom/xml/Developer.java b/src/main/java/de/eitco/cicd/bom/xml/Developer.java index add982c..0f27455 100644 --- a/src/main/java/de/eitco/cicd/bom/xml/Developer.java +++ b/src/main/java/de/eitco/cicd/bom/xml/Developer.java @@ -88,13 +88,13 @@ public static Developer fromMaven(org.apache.maven.model.Developer developer) { Developer result = new Developer(); - result.name = developer.getName(); - result.email = developer.getEmail(); - result.url = developer.getUrl(); - result.organization = developer.getOrganization(); - result.organizationUrl = developer.getOrganizationUrl(); - result.timezone = developer.getTimezone(); - result.id = developer.getId(); + result.name = developer == null ? null : developer.getName(); + result.email = developer == null ? null : developer.getEmail(); + result.url = developer == null ? null : developer.getUrl(); + result.organization = developer == null ? null : developer.getOrganization(); + result.organizationUrl = developer == null ? null : developer.getOrganizationUrl(); + result.timezone = developer == null ? null : developer.getTimezone(); + result.id = developer == null ? null : developer.getId(); return result; } diff --git a/src/main/java/de/eitco/cicd/bom/xml/License.java b/src/main/java/de/eitco/cicd/bom/xml/License.java index 266a687..9c17591 100644 --- a/src/main/java/de/eitco/cicd/bom/xml/License.java +++ b/src/main/java/de/eitco/cicd/bom/xml/License.java @@ -55,10 +55,10 @@ public static License fromMaven(org.apache.maven.model.License license) { License result = new License(); - result.name = license.getName(); - result.url = license.getUrl(); - result.distribution = license.getDistribution(); - result.comments = license.getComments(); + result.name = license == null ? null : license.getName(); + result.url = license == null ? null : license.getUrl(); + result.distribution = license == null ? null : license.getDistribution(); + result.comments = license == null ? null : license.getComments(); return result; } diff --git a/src/main/java/de/eitco/cicd/bom/xml/Organization.java b/src/main/java/de/eitco/cicd/bom/xml/Organization.java index 565d4e6..12a02f8 100644 --- a/src/main/java/de/eitco/cicd/bom/xml/Organization.java +++ b/src/main/java/de/eitco/cicd/bom/xml/Organization.java @@ -34,8 +34,8 @@ public static Organization fromMaven(org.apache.maven.model.Organization organiz Organization result = new Organization(); - result.name = organization.getName(); - result.url = organization.getUrl(); + result.name = organization == null ? null : organization.getName(); + result.url = organization == null ? null : organization.getUrl(); return result; } diff --git a/src/main/java/de/eitco/cicd/bom/xml/Scm.java b/src/main/java/de/eitco/cicd/bom/xml/Scm.java index 245441d..cf1e344 100644 --- a/src/main/java/de/eitco/cicd/bom/xml/Scm.java +++ b/src/main/java/de/eitco/cicd/bom/xml/Scm.java @@ -55,10 +55,10 @@ public static Scm fromMaven(org.apache.maven.model.Scm scm) { Scm result = new Scm(); - result.connection = scm.getConnection(); - result.developerConnection = scm.getDeveloperConnection(); - result.tag = scm.getTag(); - result.url = scm.getUrl(); + result.connection = scm == null ? null : scm.getConnection(); + result.developerConnection = scm == null ? null : scm.getDeveloperConnection(); + result.tag = scm == null ? null : scm.getTag(); + result.url = scm == null ? null : scm.getUrl(); return result; }