Skip to content

Commit d547f80

Browse files
test: add regression test for choice validation (#613) (#614)
* test: add regression test for choice validation (#613) fix: run formatter after code generation in bootstrap POMs The formatter and license plugins were running before code generation in the generate-sources phase. Changed to process-sources phase so they run after code generation completes. * fix: resolve JPMS Javadoc warnings and add aggregate javadoc - Add detectOfflineLinks=false to avoid JPMS named/unnamed module mismatch warnings during per-module site generation - Add aggregate javadoc report configuration to provide full cross-module linking in a single combined API documentation - Exclude maven-plugin from aggregate due to Maven API split packages * feat: add aggregate javadoc generation in package phase - Add maven-javadoc-plugin execution bound to package phase - Generates combined API documentation for all modules - Excludes maven-plugin due to Maven API split package issues - Output at target/reports/apidocs with full cross-module linking * fix: correct grammatical error in ValidateModuleCommand Javadoc
1 parent a60adea commit d547f80

File tree

102 files changed

+850
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+850
-45
lines changed

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ mvn install -DskipTests
128128

129129
# Generate binding classes using bootstrap POM (choose the appropriate module)
130130
# Each bootstrap POM generates classes directly into src/main/java
131-
mvn -f metaschema-testing/pom-bootstrap.xml generate-sources
132-
mvn -f databind/pom-bootstrap-config.xml generate-sources
133-
mvn -f databind/pom-bootstrap-model.xml generate-sources
131+
mvn -f metaschema-testing/pom-bootstrap.xml process-sources
132+
mvn -f databind/pom-bootstrap-config.xml process-sources
133+
mvn -f databind/pom-bootstrap-model.xml process-sources
134134
```
135135

136136
See the README.md files in each module for detailed instructions.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/CommandExecutionException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
public class CommandExecutionException
1717
extends Exception {
18+
/**
19+
* The exit code indicating the type of error that occurred.
20+
*/
1821
private final ExitCode exitCode;
1922

2023
/**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* SPDX-FileCopyrightText: none
3+
* SPDX-License-Identifier: CC0-1.0
4+
*/
5+
6+
import gov.nist.secauto.metaschema.cli.processor.command.ICommand;
7+
8+
/**
9+
* Provides a command-line interface processing framework for Metaschema tools.
10+
*
11+
* @uses ICommand to discover CLI commands via service loader
12+
*/
13+
module gov.nist.secauto.metaschema.cli.processor {
14+
// requirements
15+
requires java.base;
16+
17+
requires transitive gov.nist.secauto.metaschema.core;
18+
19+
requires static org.eclipse.jdt.annotation;
20+
requires static com.github.spotbugs.annotations;
21+
22+
requires org.apache.commons.cli;
23+
requires org.jansi.core;
24+
requires nl.talsmasoftware.lazy4j;
25+
requires org.apache.logging.log4j;
26+
requires org.apache.logging.log4j.core;
27+
requires org.apache.logging.log4j.jul;
28+
29+
exports gov.nist.secauto.metaschema.cli.processor;
30+
exports gov.nist.secauto.metaschema.cli.processor.command;
31+
exports gov.nist.secauto.metaschema.cli.processor.command.impl;
32+
exports gov.nist.secauto.metaschema.cli.processor.completion;
33+
34+
uses ICommand;
35+
}

core/src/main/java/module-info.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* implementing
1919
* {@link gov.nist.secauto.metaschema.core.metapath.function.IFunction}
2020
*/
21+
@SuppressWarnings("requires-transitive-automatic")
2122
module gov.nist.secauto.metaschema.core {
2223
// requirements
2324
requires java.base;
@@ -42,8 +43,8 @@
4243
requires transitive org.json;
4344
requires org.jsoup;
4445

45-
// dependencies without a module descriptor
46-
requires transitive everit.json.schema; // needed for validation details
46+
// dependencies without a module descriptor (automatic modules)
47+
requires transitive everit.json.schema;
4748
requires transitive flexmark;
4849
requires flexmark.ext.escaped.character;
4950
requires flexmark.ext.gfm.strikethrough;

databind-metaschema/modules

databind-metaschema/src/main/java/gov/nist/secauto/metaschema/modules/sarif/SarifValidationHandler.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,23 @@ public String getLabel() {
107107

108108
@NonNull
109109
static final String SARIF_NS = "https://docs.oasis-open.org/sarif/sarif/v2.1.0";
110+
/**
111+
* The property key for specifying a URL that provides help information for a
112+
* constraint.
113+
*/
110114
@NonNull
111115
public static final IAttributable.Key SARIF_HELP_URL_KEY
112116
= IAttributable.key("help-url", SARIF_NS);
117+
/**
118+
* The property key for specifying plain text help content for a constraint.
119+
*/
113120
@NonNull
114121
public static final IAttributable.Key SARIF_HELP_TEXT_KEY
115122
= IAttributable.key("help-text", SARIF_NS);
123+
/**
124+
* The property key for specifying markdown-formatted help content for a
125+
* constraint.
126+
*/
116127
@NonNull
117128
public static final IAttributable.Key SARIF_HELP_MARKDOWN_KEY
118129
= IAttributable.key("help-markdown", SARIF_NS);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* SPDX-FileCopyrightText: none
3+
* SPDX-License-Identifier: CC0-1.0
4+
*/
5+
6+
/**
7+
* Provides Metaschema module bindings and validation handlers including SARIF
8+
* output support.
9+
*/
10+
module gov.nist.secauto.metaschema.databind.modules {
11+
// requirements
12+
requires java.base;
13+
14+
requires transitive gov.nist.secauto.metaschema.core;
15+
requires transitive gov.nist.secauto.metaschema.databind;
16+
requires transitive gov.nist.secauto.metaschema.schemagen;
17+
18+
requires static org.eclipse.jdt.annotation;
19+
requires static com.github.spotbugs.annotations;
20+
21+
requires json.schema;
22+
23+
exports gov.nist.secauto.metaschema.modules.sarif;
24+
25+
// open generated binding classes for reflection
26+
opens org.schemastore.json.sarif.x210;
27+
}

databind/pom-bootstrap-config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This POM is used to regenerate the metaschema-bindings binding classes.
44
It is NOT part of the normal build due to circular dependencies.
55
6-
Usage: mvn -f databind/pom-bootstrap-config.xml generate-sources
6+
Usage: mvn -f databind/pom-bootstrap-config.xml process-sources
77
88
This will:
99
1. Delete existing generated classes in the config/binding package
@@ -93,7 +93,7 @@
9393
<executions>
9494
<execution>
9595
<id>add-license-headers</id>
96-
<phase>generate-sources</phase>
96+
<phase>process-sources</phase>
9797
<goals>
9898
<goal>format</goal>
9999
</goals>
@@ -116,7 +116,7 @@
116116
<executions>
117117
<execution>
118118
<id>format-generated-sources</id>
119-
<phase>generate-sources</phase>
119+
<phase>process-sources</phase>
120120
<goals>
121121
<goal>format</goal>
122122
</goals>

databind/pom-bootstrap-model.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This POM is used to regenerate the Metaschema model binding classes.
44
It is NOT part of the normal build due to circular dependencies.
55
6-
Usage: mvn -f databind/pom-bootstrap-model.xml generate-sources
6+
Usage: mvn -f databind/pom-bootstrap-model.xml process-sources
77
88
This will:
99
1. Delete existing generated classes in the model/metaschema/binding package
@@ -98,7 +98,7 @@
9898
<executions>
9999
<execution>
100100
<id>add-license-headers</id>
101-
<phase>generate-sources</phase>
101+
<phase>process-sources</phase>
102102
<goals>
103103
<goal>format</goal>
104104
</goals>
@@ -121,7 +121,7 @@
121121
<executions>
122122
<execution>
123123
<id>format-generated-sources</id>
124-
<phase>generate-sources</phase>
124+
<phase>process-sources</phase>
125125
<goals>
126126
<goal>format</goal>
127127
</goals>

databind/src/main/java/gov/nist/secauto/metaschema/databind/DefaultBindingContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public <CLASS extends IBoundObject> CLASS deepCopy(@NonNull CLASS other, IBoundO
270270
*/
271271
@Override
272272
@SuppressWarnings({
273+
"deprecation",
273274
"PMD.EmptyFinalizer",
274275
"checkstyle:NoFinalizer" })
275276
protected final void finalize() {

0 commit comments

Comments
 (0)