Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/publish_maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ buildNumber.properties
### VisualStudioCode ###
.vscode/*

.claude/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -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[]
2 changes: 1 addition & 1 deletion docs/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ To configure the plugin add a `<configuration>` block for the plugin under the `
<build>
<plugins>
<plugin>
<groupId>se.lfv.reqstool</groupId>
<groupId>io.github.reqstool</groupId>
<artifactId>reqstool-maven-plugin</artifactId>
<version>0.1.0</version>
<version>1.0.0</version>
<configuration>
<!-- File Paths -->
<requirementsAnnotationsFile>
Expand Down
10 changes: 5 additions & 5 deletions docs/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
@@ -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
<build>
<plugins>
<plugin>
<groupId>se.lfv.reqstool</groupId>
<groupId>io.github.reqstool</groupId>
<artifactId>reqstool-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
Expand All @@ -18,11 +18,11 @@ To use the LFV Reqstool Java Maven Plugin, add the following configuration to yo
</executions>
<dependencies>
<dependency>
<groupId>se.lfv.reqstool</groupId>
<groupId>io.github.reqstool</groupId>
<artifactId>reqstool-java-annotations</artifactId>
<version>0.1.2</version>
<version>1.0.0</version>
</dependency>
</dependencies>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
21 changes: 10 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>se.lfv.reqstool</groupId>
<groupId>io.github.reqstool</groupId>
<artifactId>reqstool-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0.3</version>
<version>1.0.0</version>

<name>${project.artifactId}</name>
<description>Reqstool - Maven Plugin</description>
<url>https://github.com/Luftfartsverket/reqstool-java-maven-plugin</url>
<url>https://github.com/reqstool/reqstool-java-maven-plugin</url>

<licenses>
<license>
Expand All @@ -23,24 +23,23 @@

<developers>
<developer>
<name>LFV System Developer Team</name>
<email>sysdev@lfv.se</email>
<organization>Luftfartsverket</organization>
<organizationUrl>http://www.lfv.se</organizationUrl>
<name>Reqstool Contributors</name>
<organization>reqstool</organization>
<organizationUrl>https://github.com/reqstool</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/Luftfartsverket/reqstool-java-maven-plugin.git</connection>
<url>https://github.com/Luftfartsverket/reqstool-java-maven-plugin</url>
<connection>scm:git:https://github.com/reqstool/reqstool-java-maven-plugin.git</connection>
<url>https://github.com/reqstool/reqstool-java-maven-plugin</url>
</scm>
<issueManagement>
<system>Github</system>
<url>https://github.com/Luftfartsverket/reqstool-java-maven-plugin/issues</url>
<url>https://github.com/reqstool/reqstool-java-maven-plugin/issues</url>
</issueManagement>
<ciManagement>
<system>Github</system>
<url>https://github.com/Luftfartsverket/reqstool-java-maven-plugin/actions</url>
<url>https://github.com/reqstool/reqstool-java-maven-plugin/actions</url>
</ciManagement>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -47,39 +47,57 @@
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 {

// Constants

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 {
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 9 additions & 9 deletions src/test/resources/yml/combined_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 6 additions & 6 deletions src/test/resources/yml/requirements_annotations.yml
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 5 additions & 5 deletions src/test/resources/yml/svcs_annotations.yml
Original file line number Diff line number Diff line change
@@ -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"