Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ scap/scap-schema-*.jar
scap/schemas/oval/official
scap-extensions/schemas.episode
scap-extensions/scap-schema-extensions.jar
cyberscope/target
dod-arf/target
scap/target
scap-extensions/target
Binary file added 3rd-party/Saxon-HE-9.4.jar
Binary file not shown.
Binary file added 3rd-party/codemodel-4.0.0.jar
Binary file not shown.
Binary file added 3rd-party/dtd-parser-1.5.0.jar
Binary file not shown.
Binary file added 3rd-party/istack-commons-runtime-4.1.1.jar
Binary file not shown.
Binary file added 3rd-party/istack-commons-tools-4.1.1.jar
Binary file not shown.
Binary file added 3rd-party/jakarta.activation-api-2.1.0.jar
Binary file not shown.
Binary file added 3rd-party/jakarta.xml.bind-api-4.0.0.jar
Binary file not shown.
Binary file added 3rd-party/jaxb-core-3.0.2.jar
Binary file not shown.
Binary file added 3rd-party/jaxb-impl-3.0.2.jar
Binary file not shown.
Binary file removed 3rd-party/jaxb-impl.jar
Binary file not shown.
Binary file removed 3rd-party/jaxb-xjc-2.2.6.jar
Binary file not shown.
Binary file added 3rd-party/jaxb-xjc-3.0.2.jar
Binary file not shown.
Binary file removed 3rd-party/jaxb2-namespace-prefix-1.3.jar
Binary file not shown.
Binary file added 3rd-party/jaxb2-namespace-prefix-2.0.jar
Binary file not shown.
Binary file added 3rd-party/relaxng-datatype-4.0.0.jar
Binary file not shown.
Binary file added 3rd-party/rngom-4.0.0.jar
Binary file not shown.
Binary file removed 3rd-party/saxon9he.jar
Binary file not shown.
Binary file added 3rd-party/txw2-4.0.0.jar
Binary file not shown.
Binary file added 3rd-party/xsom-4.0.0.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ TOP=$(realpath .)
include $(TOP)/common.mk

ifeq (win, $(PLATFORM))
CLASSPATH="$(shell cygpath -wp $(JAXB_BIND_API_LIB))"
SOURCEPATH="$(shell cygpath -w $(SCAP)/$(GEN))$(CLN)$(shell cygpath -w $(SCAP_EXT)/$(GEN))"
else
CLASSPATH=$(JAXB_BIND_API_LIB)
SOURCEPATH=$(SCAP)/$(GEN)$(CLN)$(SCAP_EXT)/$(GEN)
endif

all: $(SCAP_LIB) $(SCAP_EXT_LIB) $(DOCS)/index.html $(CYBERSCOPE_LIB) $(DODARF_LIB)

$(DOCS)/index.html: $(SCAP_LIB) $(SCAP_EXT_LIB)
mkdir -p $(DOCS)
$(JAVADOC) $(JAVADOCFLAGS) -d $(DOCS) -sourcepath $(SOURCEPATH) -subpackages org:scap
$(JAVADOC) $(JAVADOCFLAGS) -cp $(CLASSPATH) -d $(DOCS) -sourcepath $(SOURCEPATH) -subpackages org:scap

$(SCAP_LIB): $(SCAP)/$(BINDINGS)
@$(MAKE) --directory=$(SCAP)
Expand Down
47 changes: 30 additions & 17 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,43 @@ ifeq (win, $(PLATFORM))
JAR=$(WIN_JAVA_HOME)/bin/jar.exe
JAVADOC=$(WIN_JAVA_HOME)/bin/javadoc.exe
JAVAC=$(WIN_JAVA_HOME)/bin/javac.exe
CLASSLIB=$(shell cygpath -w $(JAVA_HOME))\jre\lib\rt.jar
NUMPROCS=1
else
JAVA=$(JAVA_HOME)/bin/java
JAR=$(JAVA_HOME)/bin/jar
JAVADOC=$(JAVA_HOME)/bin/javadoc
JAVAC=$(JAVA_HOME)/bin/javac
CLASSLIB=$(JAVA_HOME)/jre/lib/rt.jar
ifeq (mac, $(PLATFORM))
NUMPROCS=$(shell sysctl -n hw.ncpu)
else
NUMPROCS=$(shell nproc)
endif
endif
RAW_JAVA_VERSION:=$(shell $(JAVA_HOME)/bin/java -version 2>&1)
ifeq (1.8, $(findstring 1.8, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.8
RAW_JAVA_VERSION:=$(shell "$(JAVA_HOME)/bin/java" -version 2>&1)
ifeq (11, $(findstring 11, $(findstring "11., $(RAW_JAVA_VERSION))))
JAVA_VERSION=11
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (12, $(findstring 12, $(findstring "12., $(RAW_JAVA_VERSION))))
JAVA_VERSION=12
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (13, $(findstring 13, $(findstring "13., $(RAW_JAVA_VERSION))))
JAVA_VERSION=13
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (14, $(findstring 14, $(findstring "14., $(RAW_JAVA_VERSION))))
JAVA_VERSION=14
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (15, $(findstring 15, $(findstring "15., $(RAW_JAVA_VERSION))))
JAVA_VERSION=15
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (16, $(findstring 16, $(findstring "16., $(RAW_JAVA_VERSION))))
JAVA_VERSION=16
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (17, $(findstring 17, $(findstring "17., $(RAW_JAVA_VERSION))))
JAVA_VERSION=17
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (18, $(findstring 18, $(findstring "18., $(RAW_JAVA_VERSION))))
JAVA_VERSION=18
JAVADOCFLAGS=-Xdoclint:none -J-Xmx512m
else ifeq (1.7, $(findstring 1.7, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.7
JAVADOCFLAGS=-J-Xmx512m
else ifeq (1.6, $(findstring 1.6, $(RAW_JAVA_VERSION)))
JAVA_VERSION=1.6
JAVADOCFLAGS=-J-Xmx512m
else
$(error "Unsupported Java version: $(RAW_JAVA_VERSION)")
endif
Expand All @@ -69,11 +82,11 @@ SCHEMADIR=schemas
OVAL_SRC=$(THIRDPARTY)/OVAL/oval-schemas
OVAL_SCHEMA=$(SCHEMADIR)/oval
BINDINGS=$(SCHEMADIR)/bindings.xjb
CATALOG=schemas.cat
CATALOG=schemas.xml
EPISODE=schemas.episode
XJCFLAGS=-enableIntrospection -catalog $(CATALOG) -episode $(EPISODE)
XJCFLAGS_EXT=-classpath "$(NAMESPACE_PLUGIN)" $(XJCFLAGS) -extension -Xnamespace-prefix
XJC=$(JAVA) -Djavax.xml.accessExternalSchema=all -Dcom.sun.tools.xjc.XJCFacade.nohack=true -cp $(XJC_LIB) com.sun.tools.xjc.XJCFacade
XJCFLAGS_EXT=$(XJCFLAGS) -extension -Xnamespace-prefix
XJC=$(JAVA) -Djavax.xml.accessExternalSchema=all -Dcom.sun.tools.xjc.XJCFacade.nohack=true -cp "$(XJC_LIBS)" com.sun.tools.xjc.XJCFacade

#
# Make namespaces optional in the episode bindings
Expand All @@ -91,6 +104,6 @@ DODARF=$(TOP)/dod-arf
DODARF_LIB=$(DODARF)/DoD-ARF-schema.jar

THIRDPARTY=$(TOP)/3rd-party
SAXON_LIB=$(THIRDPARTY)/saxon9he.jar
XJC_LIB=$(THIRDPARTY)/jaxb-xjc-2.2.6.jar
NAMESPACE_PLUGIN=$(THIRDPARTY)/jaxb2-namespace-prefix-1.3.jar
SAXON_LIB=$(THIRDPARTY)/Saxon-HE-9.4.jar
JAXB_BIND_API_LIB=$(THIRDPARTY)/jakarta.xml.bind-api-4.0.0.jar
XJC_LIBS=$(THIRDPARTY)/jaxb-xjc-3.0.2.jar$(CLN)$(THIRDPARTY)/jaxb-core-3.0.2.jar$(CLN)$(THIRDPARTY)/jaxb-impl-3.0.2.jar$(CLN)$(JAXB_BIND_API_LIB)$(CLN)$(THIRDPARTY)/jakarta.activation-api-2.1.0.jar$(CLN)$(THIRDPARTY)/istack-commons-runtime-4.1.1.jar$(CLN)$(THIRDPARTY)/jaxb2-namespace-prefix-2.0.jar$(CLN)$(THIRDPARTY)/rngom-4.0.0.jar$(CLN)$(THIRDPARTY)/relaxng-datatype-4.0.0.jar$(CLN)$(THIRDPARTY)/dtd-parser-1.5.0.jar$(CLN)$(THIRDPARTY)/xsom-4.0.0.jar$(CLN)$(THIRDPARTY)/codemodel-4.0.0.jar$(CLN)$(THIRDPARTY)/txw2-4.0.0.jar
10 changes: 8 additions & 2 deletions cyberscope/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
TOP=..
include $(TOP)/common.mk

CLASSPATH="$(CLASSLIB)$(CLN)$(SCAP_LIB)$(CLN)$(GEN)"
ifeq (win, $(PLATFORM))
CLASSPATH="$(shell cygpath -wp $(JAXB_BIND_API_LIB))$(CLN)$(shell cygpath -wp $(SCAP_LIB))$(CLN)$(shell cygpath -wp $(GEN))"
JAVADOCCP="$(shell cygpath -wp $(JAXB_BIND_API_LIB))$(CLN)$(shell cygpath -wp $(SCAP)/$(BUILD))"
else
CLASSPATH="$(JAXB_BIND_API_LIB)$(CLN)$(SCAP_LIB)$(CLN)$(GEN)"
JAVADOCCP="$(JAXB_BIND_API_LIB)$(CLN)$(SCAP)/$(BUILD)"
endif

include classes.mk
include schemas.mk
Expand All @@ -20,7 +26,7 @@ $(CYBERSCOPE_LIB): $(GEN) classes resources $(DOCS)
$(JAR) cvf $@ -C $(BUILD)/ .

$(DOCS): $(GEN)
$(JAVADOC) $(JAVADOCFLAGS) -d $(DOCS) -sourcepath $(GEN) -subpackages cyberscope -classpath $(SCAP)/$(BUILD)/
$(JAVADOC) $(JAVADOCFLAGS) -d $(DOCS) -sourcepath $(GEN) -subpackages cyberscope -classpath $(JAVADOCCP)

clean:
rm -f $(EPISODE)
Expand Down
172 changes: 172 additions & 0 deletions cyberscope/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<artifactId>jOVAL</artifactId>
<groupId>com.joval</groupId>
<version>poc</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>com.joval</groupId>
<artifactId>cyberscope-schema</artifactId>
<name>${project.artifactId}</name>
<version>latest</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.joval</groupId>
<artifactId>scap-schema</artifactId>
<version>latest</version>
</dependency>
</dependencies>

<build>
<finalName>cyberscope-schema</finalName>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>Process episode file for cyberscope</id>
<phase>prepare-package</phase>
<configuration>
<target>
<replaceregexp match="${BROKEN}" replace="${FIXED}" byline="true">
<fileset dir="${project.build.outputDirectory}/META-INF/JAXB/" includes="episode_xjc-*.xjb"/>
</replaceregexp>
<copy todir="${project.build.outputDirectory}/META-INF">
<fileset dir="${project.build.outputDirectory}/META-INF/JAXB/" includes="episode_xjc-*.xjb"/>
<globmapper from="*" to="sun-jaxb.episode"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin-version}</version>
<executions>
<execution>
<id>copy catalog file (schemas.xml) for cyberscope</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/cyberscope</outputDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>schemas.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy registry.ini for cyberscope</id>
<phase>process-classes</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/cyberscope</outputDirectory>
<resources>
<resource>
<directory>${basedir}/rsrc</directory>
<includes>
<include>registry.ini</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy schemas for cyberscope</id>
<phase>process-classes</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/cyberscope/schemas</outputDirectory>
<resources>
<resource>
<directory>${SCHEMADIR}</directory>
<excludes>
<exclude>bindings.xjb</exclude>
</excludes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>${jaxb2-maven-plugin.version}</version>
<executions>
<execution>
<id>xjc-cyberscope</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<verbose>true</verbose>
<enableIntrospection>true</enableIntrospection>
<extension>true</extension>
<arguments>
<argument>-Xnamespace-prefix</argument>
</arguments>
<catalog>schemas.xml</catalog>
<xjbSources>
<xjbSource>${SCHEMADIR}//bindings.xjb</xjbSource>
</xjbSources>
<sourceType>XmlSchema</sourceType>
<sources>
<source>${SCHEMADIR}/ai-1.0-ea1/asset-identification_1.0.0-ea1.xsd</source>
<source>${SCHEMADIR}/arf-1.0-ea1/asset-reporting-format_1.0.0-ea1.xsd</source>
<source>${SCHEMADIR}/lasr-1.0-ea1/lightweight-asset-summary-results_1.0.0-ea1.xsd</source>
<source>${SCHEMADIR}/oasis/CommonTypes.xsd</source>
<source>${SCHEMADIR}/oasis/xAL.xsd</source>
<source>${SCHEMADIR}/oasis/xNL.xsd</source>
<source>../scap/target/scap-schema-${SCAP_VERSION}.jar</source>
</sources>
<outputDirectory>${GEN}</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${org.glassfish.jaxb.xjc.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions cyberscope/schemas.cat

This file was deleted.

17 changes: 17 additions & 0 deletions cyberscope/schemas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE catalog
PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN"
"http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">

<catalog prefer="system" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="http://scap.nist.gov/schema/asset-identification/1.0" uri="schemas/ai-1.0-ea1/asset-identification_1.0.0-ea1.xsd"/>
<public publicId="http://scap.nist.gov/schema/asset-reporting-format/1.0" uri="schemas/arf-1.0-ea1/asset-reporting-format_1.0.0-ea1.xsd"/>
<public publicId="http://scap.nist.gov/schema/lightweight-asset-summary-results/1.0" uri="schemas/lasr-1.0-ea1/lightweight-asset-summary-results_1.0.0-ea1.xsd"/>
<public publicId="urn:oasis:names:tc:ciq:ct:3" uri="schemas/oasis/CommonTypes.xsd"/>
<public publicId="urn:oasis:names:tc:ciq:xal:3" uri="schemas/oasis/xAL.xsd"/>
<public publicId="urn:oasis:names:tc:ciq:xnl:3" uri="schemas/oasis/xNL.xsd"/>
<system systemId="datatypes.dtd" uri="../scap/schemas/xml/datatypes.dtd"/>
<public publicId="http://www.w3.org/1999/xlink" uri="../scap/schemas/xml/xlink.xsd"/>
<public publicId="http://www.w3.org/XML/1998/namespace" uri="../scap/schemas/xml/xml.xsd"/>
<system systemId="XMLSchema.dtd" uri="../scap/schemas/xml/XMLSchema.dtd"/>
</catalog>
4 changes: 2 additions & 2 deletions cyberscope/schemas/bindings.xjb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt

-->
<jxb:bindings version="1.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
<jxb:bindings version="3.0"
xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix">
<jxb:bindings>
Expand Down
10 changes: 8 additions & 2 deletions dod-arf/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
TOP=..
include $(TOP)/common.mk

CLASSPATH="$(CLASSLIB)$(CLN)$(SCAP_LIB)$(CLN)$(GEN)"
ifeq (win, $(PLATFORM))
CLASSPATH="$(shell cygpath -wp $(JAXB_BIND_API_LIB))$(CLN)$(shell cygpath -wp $(SCAP_LIB))$(CLN)$(shell cygpath -wp $(GEN))"
JAVADOCCP="$(shell cygpath -wp $(JAXB_BIND_API_LIB))$(CLN)$(shell cygpath -wp $(SCAP)/$(BUILD))"
else
CLASSPATH="$(JAXB_BIND_API_LIB)$(CLN)$(SCAP_LIB)$(CLN)$(GEN)"
JAVADOCCP="$(JAXB_BIND_API_LIB)$(CLN)$(SCAP)/$(BUILD)"
endif

include classes.mk

Expand All @@ -19,7 +25,7 @@ $(DODARF_LIB): $(GEN) classes resources $(DOCS)
$(JAR) cvf $@ -C $(BUILD)/ .

$(DOCS): $(GEN)
$(JAVADOC) $(JAVADOCFLAGS) -d $(DOCS) -sourcepath $(GEN) -subpackages gov:mil.disa -classpath $(SCAP)/$(BUILD)/
$(JAVADOC) $(JAVADOCFLAGS) -d $(DOCS) -sourcepath $(GEN) -subpackages gov:mil.disa -classpath $(JAVADOCCP)

clean:
rm -f $(EPISODE)
Expand Down
Loading