diff --git a/.github/workflows/publish_maven.yml b/.github/workflows/publish_maven.yml index a8ac42d..c8209e7 100644 --- a/.github/workflows/publish_maven.yml +++ b/.github/workflows/publish_maven.yml @@ -26,13 +26,14 @@ jobs: java-version: "21" distribution: "temurin" server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.SYSDEV_PRIVATE_GPG_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.REQSTOOL_PRIVATE_GPG_KEY }} + gpg-passphrase: REQSTOOL_PRIVATE_GPG_PASSPHRASE - name: Publish to the Maven Central Repository run: mvn clean deploy env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.SYSDEV_PRIVATE_GPG_KEY_PASSPHRASE }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + REQSTOOL_PRIVATE_GPG_PASSPHRASE: ${{ secrets.REQSTOOL_PRIVATE_GPG_PASSPHRASE }} + diff --git a/.gitignore b/.gitignore index 88c6d79..1c7c3d1 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ buildNumber.properties ### VisualStudioCode ### .vscode/* +.claude/ diff --git a/LICENSE b/LICENSE index 5ea452a..fc689cb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 LFV +Copyright (c) 2024 reqstool Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.adoc b/README.adoc index 45ddb5b..5d99c57 100644 --- a/README.adoc +++ b/README.adoc @@ -1,9 +1,9 @@ -image:https://img.shields.io/github/commit-activity/m/Luftfartsverket/reqstool-java-maven-plugin?label=commits&style=for-the-badge["Commit Activity", link="https://github.com/Luftfartsverket/reqstool-java-maven-plugin/pulse"] -image:https://img.shields.io/github/issues/Luftfartsverket/reqstool-java-maven-plugin?style=for-the-badge&logo=github["GitHub Issues", link="https://github.com/Luftfartsverket/reqstool-java-maven-plugin/issues"] +image:https://img.shields.io/github/commit-activity/m/reqstool/reqstool-java-maven-plugin?label=commits&style=for-the-badge["Commit Activity", link="https://github.com/reqstool/reqstool-java-maven-plugin/pulse"] +image:https://img.shields.io/github/issues/reqstool/reqstool-java-maven-plugin?style=for-the-badge&logo=github["GitHub Issues", link="https://github.com/reqstool/reqstool-java-maven-plugin/issues"] image:https://img.shields.io/badge/Java-21-brightgreen.svg?style=for-the-badge["JVM support", link="https://sdkman.io"] -image:https://img.shields.io/github/license/Luftfartsverket/reqstool-java-maven-plugin?style=for-the-badge&logo=opensourceinitiative["License", link="https://opensource.org/license/mit/"] -image:https://img.shields.io/github/actions/workflow/status/Luftfartsverket/reqstool-java-maven-plugin/build.yml?style=for-the-badge&logo=github["Build", link="https://github.com/Luftfartsverket/reqstool-java-maven-plugin/actions/workflows/build.yml"] -image:https://img.shields.io/badge/Documentation-blue?style=for-the-badge&link=docs["Static Badge", link="https://luftfartsverket.github.io/reqstool-java-maven-plugin/"] +image:https://img.shields.io/github/license/reqstool/reqstool-java-maven-plugin?style=for-the-badge&logo=opensourceinitiative["License", link="https://opensource.org/license/mit/"] +image:https://img.shields.io/github/actions/workflow/status/reqstool/reqstool-java-maven-plugin/build.yml?style=for-the-badge&logo=github["Build", link="https://github.com/reqstool/reqstool-java-maven-plugin/actions/workflows/build.yml"] +image:https://img.shields.io/badge/Documentation-blue?style=for-the-badge&link=docs["Static Badge", link="https://reqstool.github.io/reqstool-java-maven-plugin/"] include::docs/modules/ROOT/pages/index.adoc[] diff --git a/docs/antora-playbook.yml b/docs/antora-playbook.yml index d9871a4..725bdce 100644 --- a/docs/antora-playbook.yml +++ b/docs/antora-playbook.yml @@ -2,7 +2,7 @@ site: title: Reqstool Maven Plugin - url: https://github.com/luftfartsverket/reqstool-java-maven-plugin + url: https://github.com/reqstool/reqstool-java-maven-plugin start_page: reqstool-java-maven-plugin::index.adoc content: diff --git a/docs/antora.yml b/docs/antora.yml index c3e2f00..a56fdb8 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -2,6 +2,6 @@ name: reqstool-java-maven-plugin title: Reqstool Maven Plugin -version: 0.0.3 +version: 1.0.0 nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/configuration.adoc b/docs/modules/ROOT/pages/configuration.adoc index a216ca1..2292909 100644 --- a/docs/modules/ROOT/pages/configuration.adoc +++ b/docs/modules/ROOT/pages/configuration.adoc @@ -8,9 +8,9 @@ To configure the plugin add a `` block for the plugin under the ` - se.lfv.reqstool + io.github.reqstool reqstool-maven-plugin - 0.1.0 + 1.0.0 diff --git a/docs/modules/ROOT/pages/usage.adoc b/docs/modules/ROOT/pages/usage.adoc index 01188c5..6a9ec78 100644 --- a/docs/modules/ROOT/pages/usage.adoc +++ b/docs/modules/ROOT/pages/usage.adoc @@ -1,12 +1,12 @@ == Usage -To use the LFV Reqstool Java Maven Plugin, add the following configuration to your Maven project's `pom.xml`: +To use the Reqstool Java Maven Plugin, add the following configuration to your Maven project's `pom.xml`: ```xml - se.lfv.reqstool + io.github.reqstool reqstool-maven-plugin 1.0.0 @@ -18,11 +18,11 @@ To use the LFV Reqstool Java Maven Plugin, add the following configuration to yo - se.lfv.reqstool + io.github.reqstool reqstool-java-annotations - 0.1.2 + 1.0.0 - + diff --git a/pom.xml b/pom.xml index 2a5fb83..e4f8452 100644 --- a/pom.xml +++ b/pom.xml @@ -5,14 +5,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - se.lfv.reqstool + io.github.reqstool reqstool-maven-plugin maven-plugin - 1.0.3 + 1.0.0 ${project.artifactId} Reqstool - Maven Plugin - https://github.com/Luftfartsverket/reqstool-java-maven-plugin + https://github.com/reqstool/reqstool-java-maven-plugin @@ -23,24 +23,23 @@ - LFV System Developer Team - sysdev@lfv.se - Luftfartsverket - http://www.lfv.se + Reqstool Contributors + reqstool + https://github.com/reqstool - scm:git:https://github.com/Luftfartsverket/reqstool-java-maven-plugin.git - https://github.com/Luftfartsverket/reqstool-java-maven-plugin + scm:git:https://github.com/reqstool/reqstool-java-maven-plugin.git + https://github.com/reqstool/reqstool-java-maven-plugin Github - https://github.com/Luftfartsverket/reqstool-java-maven-plugin/issues + https://github.com/reqstool/reqstool-java-maven-plugin/issues Github - https://github.com/Luftfartsverket/reqstool-java-maven-plugin/actions + https://github.com/reqstool/reqstool-java-maven-plugin/actions diff --git a/src/main/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojo.java b/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java similarity index 89% rename from src/main/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojo.java rename to src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java index 10b1408..eec2891 100644 --- a/src/main/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojo.java +++ b/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java @@ -1,5 +1,5 @@ -// Copyright © LFV -package se.lfv.reqstool.plugins.maven; +// Copyright © reqstool +package io.github.reqstool.plugins.maven; import java.io.File; import java.io.FileOutputStream; @@ -47,6 +47,11 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; +/** + * Maven Mojo for assembling and attaching reqstool artifacts. This plugin packages + * requirements, test results, and annotations into a ZIP artifact during the verify phase + * of the Maven build lifecycle. + */ @Mojo(name = "assemble-and-attach-zip-artifact", defaultPhase = LifecyclePhase.VERIFY) public class RequirementsToolMojo extends AbstractMojo { @@ -54,32 +59,45 @@ public class RequirementsToolMojo extends AbstractMojo { private static final String[] OUTPUT_ARTIFACT_TEST_RESULTS_PATTERN = { "test_results/**/*.xml" }; + /** Input file name for manual verification results. */ public static final String INPUT_FILE_MANUAL_VERIFICATION_RESULTS_YML = "manual_verification_results.yml"; + /** Input file name for requirements. */ public static final String INPUT_FILE_REQUIREMENTS_YML = "requirements.yml"; + /** Input file name for software verification cases. */ public static final String INPUT_FILE_SOFTWARE_VERIFICATION_CASES_YML = "software_verification_cases.yml"; + /** Input dataset directory path. */ public static final String INPUT_PATH_DATASET = "reqstool"; + /** Output file name for annotations. */ public static final String OUTPUT_FILE_ANNOTATIONS_YML_FILE = "annotations.yml"; private static final String OUTPUT_ARTIFACT_CLASSIFIER = "reqstool"; + /** Output artifact file name for reqstool configuration. */ public static final String OUTPUT_ARTIFACT_FILE_REQSTOOL_CONFIG_YML = "reqstool_config.yml"; + /** Output artifact directory name for test results. */ public static final String OUTPUT_ARTIFACT_DIR_TEST_RESULTS = "test_results"; + /** XML element name for implementations. */ public static final String XML_IMPLEMENTATIONS = "implementations"; + /** XML element name for requirement annotations. */ public static final String XML_REQUIREMENT_ANNOTATIONS = "requirement_annotations"; + /** XML element name for tests. */ public static final String XML_TESTS = "tests"; - protected static final String YAML_LANG_SERVER_SCHEMA_ANNOTATIONS = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"; + /** YAML language server schema annotation. */ + protected static final String YAML_LANG_SERVER_SCHEMA_ANNOTATIONS = "# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json"; - protected static final String YAML_LANG_SERVER_SCHEMA_CONFIG = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/reqstool_config.schema.json"; + /** YAML language server schema for configuration. */ + protected static final String YAML_LANG_SERVER_SCHEMA_CONFIG = "# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/reqstool_config.schema.json"; + /** ObjectMapper for YAML serialization and deserialization. */ protected static final ObjectMapper yamlMapper; static { @@ -122,6 +140,16 @@ public class RequirementsToolMojo extends AbstractMojo { @Parameter(property = "reqstool.skipAttachZipArtifact", defaultValue = "false") private boolean skipAttachZipArtifact; + /** Default constructor. */ + public RequirementsToolMojo() { + } + + /** + * Executes the Mojo goal to assemble and attach the reqstool ZIP artifact. Combines + * requirement and test annotations, assembles them into a ZIP file with requirements + * and test results, and attaches the artifact to the Maven project. + * @throws MojoExecutionException if an error occurs during execution + */ public void execute() throws MojoExecutionException { if (skip) { getLog().info("Skipping execution of reqstool plugin"); diff --git a/src/test/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojoTests.java b/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java similarity index 98% rename from src/test/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojoTests.java rename to src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java index da19b3b..c1d02c3 100644 --- a/src/test/java/se/lfv/reqstool/plugins/maven/RequirementsToolMojoTests.java +++ b/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java @@ -1,5 +1,5 @@ -// Copyright © LFV -package se.lfv.reqstool.plugins.maven; +// Copyright © reqstool +package io.github.reqstool.plugins.maven; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/resources/yml/combined_annotations.yml b/src/test/resources/yml/combined_annotations.yml index 26ed176..4d6f686 100644 --- a/src/test/resources/yml/combined_annotations.yml +++ b/src/test/resources/yml/combined_annotations.yml @@ -3,27 +3,27 @@ requirement_annotations: implementations: REQ_001: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" REQ_002: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" REQ_003: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" - elementKind: "METHOD" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.someMethod1" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.someMethod1" REQ_004: - elementKind: "FIELD" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.field" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.field" tests: SVC_001: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" SVC_002: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" SVC_003: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" - elementKind: "METHOD" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample.someMethod" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample.someMethod" diff --git a/src/test/resources/yml/requirements_annotations.yml b/src/test/resources/yml/requirements_annotations.yml index 8c250f5..70de55c 100644 --- a/src/test/resources/yml/requirements_annotations.yml +++ b/src/test/resources/yml/requirements_annotations.yml @@ -1,18 +1,18 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json --- requirement_annotations: implementations: REQ_001: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" REQ_002: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" REQ_003: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample" - elementKind: "METHOD" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.someMethod1" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.someMethod1" REQ_004: - elementKind: "FIELD" - fullyQualifiedName: "se.lfv.reqstool.annotations.RequirementsExample.field" + fullyQualifiedName: "io.github.reqstool.annotations.RequirementsExample.field" diff --git a/src/test/resources/yml/svcs_annotations.yml b/src/test/resources/yml/svcs_annotations.yml index a953532..e102df6 100644 --- a/src/test/resources/yml/svcs_annotations.yml +++ b/src/test/resources/yml/svcs_annotations.yml @@ -1,15 +1,15 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Luftfartsverket/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/reqstool/reqstool-client/main/src/reqstool/resources/schemas/v1/annotations.schema.json --- requirement_annotations: tests: SVC_001: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" SVC_002: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" SVC_003: - elementKind: "CLASS" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample" - elementKind: "METHOD" - fullyQualifiedName: "se.lfv.reqstool.annotations.SVCsExample.someMethod" + fullyQualifiedName: "io.github.reqstool.annotations.SVCsExample.someMethod"