Skip to content

Commit

Permalink
More build streamlining.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Jul 15, 2023
1 parent fe775f8 commit df938cc
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 433 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ jobs:
- name: Test Website
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 site site:stage
mvn -B -e -Prelease -Preporting install site site:stage
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# -------------------------
- name: Build Website
run: |
mvn -B -e -Pgpg -Prelease -Preporting site site:stage
mvn -B -e -Pgpg -Prelease -Preporting install site site:stage
- name: Run Website Deploy Script
run: |
touch target/staging/.nojekyll
Expand Down
2 changes: 1 addition & 1 deletion cli-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>cli-processor</artifactId>
<packaging>jar</packaging>

<name>OSCAL CLI Framework</name>
<name>Metaschema CLI Framework</name>
<url>http://maven.apache.org</url>

<properties>
Expand Down
3 changes: 1 addition & 2 deletions metaschema-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
<targetPath>${project.build.directory}/generated-distro</targetPath>
</resource>
<resource>
<directory>
${project.build.directory}/generated-resources/license</directory>
<directory>${project.build.directory}/generated-resources/license</directory>
</resource>
</resources>
<plugins>
Expand Down
16 changes: 0 additions & 16 deletions metaschema-java-binding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,4 @@
<!-- <scope>test</scope> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<ignoredDependency>com.google.auto.service:auto-service</ignoredDependency>
</ignoredDependencies>
<usedDependencies>
<usedDependency>org.apache.logging.log4j:log4j-core</usedDependency>
</usedDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
4 changes: 2 additions & 2 deletions metaschema-java-binding/src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</Console>
</Appenders>
<Loggers>
<Logger name="gov.nist.secauto.metaschema" level="debug" additivity="false">
<Logger name="gov.nist.secauto.metaschema" level="info" additivity="false">
<AppenderRef ref="console" />
</Logger>
<Root level="debug">
<Root level="info">
<AppenderRef ref="console" />
</Root>
</Loggers>
Expand Down
17 changes: 0 additions & 17 deletions metaschema-java-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Expand All @@ -102,13 +92,6 @@
</excludeRoots>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ private static void runTests(
String xml;
{
Object root = read(Format.XML, xmlExample, rootClass);
LOGGER.info("Read XML: Object: {}", root.toString());
LOGGER.atDebug().log("Read XML: Object: {}", root.toString());
if (assertions != null) {
assertAll("Deserialize XML", () -> {
assertions.accept(root);
});
}

LOGGER.info("Write XML:");
LOGGER.atDebug().log("Write XML:");
write(Format.XML, ObjectUtils.notNull(Paths.get("target/out.xml")), root);

LOGGER.info("Write JSON:");
LOGGER.atDebug().log("Write JSON:");
write(Format.XML, ObjectUtils.notNull(Paths.get("target/out.json")), root);
}

Expand Down
22 changes: 0 additions & 22 deletions metaschema-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
Expand Down Expand Up @@ -151,18 +141,6 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<ignoredDependency>com.google.auto.service:auto-service</ignoredDependency>
</ignoredDependencies>
<usedDependencies>
<usedDependency>org.apache.logging.log4j:log4j-core</usedDependency>
</usedDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
Expand Down
51 changes: 1 addition & 50 deletions metaschema-model-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,7 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>
${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Expand All @@ -179,29 +169,6 @@
</excludeRoots>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${dependency.auto-service.version}</version>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<version>${dependency.auto-service.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand All @@ -228,22 +195,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<ignoredDependency>com.google.auto.service:auto-service</ignoredDependency>
</ignoredDependencies>
<usedDependencies>
<usedDependency>org.apache.logging.log4j:log4j-core</usedDependency>
</usedDependencies>
</configuration>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ void markupLineFromMarkdownTest() {

Assertions.assertNotNull(document);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(document));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(document));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

// Document[0, 49]
List<Node> documentChildren = CollectionUtil.toList(document.getChildren());
Expand Down Expand Up @@ -174,9 +174,9 @@ void markupMultilineFromMarkdownTest() throws XMLStreamException, IOException {
+ "<p>A param: <insert type=\"param\" id-ref=\"insert\"/>.</p>";

MarkupMultiline ms = MarkupMultiline.fromMarkdown(markdown);
LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toXHtml(""));
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toXHtml(""));
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toXHtml(""));
Expand Down Expand Up @@ -207,10 +207,10 @@ void markupMultilineFromHtmlTest() throws XMLStreamException, IOException {
+ "\n"
+ "Some \"*more*\" **text** ![alt](src)";
MarkupMultiline ms = MarkupMultiline.fromHtml(html);
LOGGER.atInfo().log("HTML Source: {}", html);
LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toXHtml(""));
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("HTML Source: {}", html);
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toXHtml(""));
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());
Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toXHtml(""));
}
Expand All @@ -225,10 +225,10 @@ void markupSpaceHandlingTest() throws XMLStreamException, IOException {
final String html = "<p>a <q><em>b</em></q> <strong>c</strong></p>";
final String markdown = "a <q>*b*</q> **c**";
MarkupMultiline ms = MarkupMultiline.fromHtml(html);
LOGGER.atInfo().log("HTML Source: {}", html);
LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toXHtml(""));
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("HTML Source: {}", html);
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toXHtml(""));
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());
Assertions.assertNotEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toXHtml(""));
}
Expand All @@ -244,9 +244,9 @@ void preMarkdown() {

MarkupMultiline ms = MarkupMultiline.fromHtml(htmlPreOnly);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toHtml());
Expand All @@ -262,9 +262,9 @@ void preCodeMarkdown() {

MarkupMultiline ms = MarkupMultiline.fromHtml(html);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toHtml());
Expand All @@ -276,9 +276,9 @@ void paragraphCodeMarkdown() {
final String markdown = "Example`**some** *code*`";
MarkupMultiline ms = MarkupMultiline.fromHtml(html);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toHtml());
Expand All @@ -295,9 +295,9 @@ void testEntityRoundTrip() throws XMLStreamException {

Assertions.assertNotNull(document);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toHtml().trim());
Expand Down Expand Up @@ -326,9 +326,9 @@ void testAposRoundTrip() throws XMLStreamException {

Assertions.assertNotNull(document);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

Assertions.assertEquals(markdown, ms.toMarkdown());

Expand All @@ -353,9 +353,9 @@ void testAposRoundTrip() throws XMLStreamException {
document = ms.getDocument();

Assertions.assertNotNull(document);
LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());
Assertions.assertEquals(markdown, ms.toMarkdown());
Assertions.assertEquals(html, ms.toHtml().trim());
}
Expand All @@ -365,10 +365,9 @@ void testHtml() {
String html = "<p>before &lt;thing[02] text&gt; after</p>";
MarkupMultiline ms = MarkupMultiline.fromHtml(html);

LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());

LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(ms.getDocument()));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());
}

@Test
Expand All @@ -380,9 +379,9 @@ void testIntraTagNewline() {
MarkupMultiline ms = MarkupMultiline.fromHtml(html);

Document doc = ms.getDocument();
LOGGER.atInfo().log("AST: {}", AstCollectingVisitor.asString(doc));
LOGGER.atInfo().log("HTML: {}", ms.toHtml());
LOGGER.atInfo().log("Markdown: {}", ms.toMarkdown());
LOGGER.atDebug().log("AST: {}", AstCollectingVisitor.asString(doc));
LOGGER.atDebug().log("HTML: {}", ms.toHtml());
LOGGER.atDebug().log("Markdown: {}", ms.toMarkdown());

List<Node> children = CollectionUtil.toList(doc.getChildren());
// ensure there is only 1 child and that it is a heading
Expand Down
Loading

0 comments on commit df938cc

Please sign in to comment.