diff --git a/.travis.yml b/.travis.yml index 6f988d3..f887409 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ env: GRADLE_OPTS=-Dorg.gradle.daemon=true env: CI_OPTS=--stacktrace install: /bin/true -script: "./gradlew -x signArchives" \ No newline at end of file +script: "./gradlew -x signArchives" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1838bd2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,78 @@ +############################################################ +# A Dockerfile used to create a java-stix build container +# based on Ubunu. +# +# Copyright (c) 2015, The MITRE Corporation. All rights reserved. +# See LICENSE for complete terms. +# +# @author nemonik (Michael Joseph Walsh ) +# +# WHAT TO DO: +# +# If you have Docker installed, from the root of the project run +# the following to create a container image for this Dockerfile via: +# +# docker build -t java_stix_img . +# +# Then create a container using the image you just created via: +# +# docker run -t -i java_stix_img_v1_1_1_1 /bin/bash +# +# To retreive the jar archives from the running docker container use following +# from the command-line of your docker host, not the container: +# +# docker cp :/java-stix/build/libs/stix-1.1.1.1-SNAPSHOT-javadoc.jar . +# docker cp :/java-stix/build/libs/stix-1.1.1.1-SNAPSHOT-sources.jar . +# docker cp :/java-stix/build/libs/stix-1.1.1.1-SNAPSHOT.jar . +# +# If the containder ID is not obvious, but you can also retrieve it via: +# +# docker ps +# +# An example of retrieving the snapshot jar would be the following: +# +# ➜ /tmp docker cp 83ad9afb6096:/java-stix/build/libs/stix-1.1.1.1-SNAPSHOT.jar . +# +# +############################################################ + +# Set base image +FROM ubuntu:15.04 + +# File Maintainer +MAINTAINER Michael Joseph Walsh + +# Update the sources list +RUN apt-get -y update + +# Install cmd-line dev toolchain +RUN apt-get install -y tar git curl nano wget dialog net-tools build-essential software-properties-common + +# To install the default OpenJDK environment +RUN add-apt-repository -y ppa:openjdk-r/ppa +RUN apt-get -y update +RUN apt-get -y install openjdk-8-jdk + +# To install the OpenJDK 7, comment out the above and uncomment the following. +#RUN apt-get install -y openjdk-7-jdk + +# Optionally to install the Oracle JDK, comment out the above, uncomment the +# the next 3 lines, and then uncommment the preferred JDK version. +#RUN apt-get -y install python-software-properties +#RUN add-apt-repository -y ppa:webupd8team/java +#RUN apt-get -y update + +#RUN apt-get install oracle-java7-installer +#RUN apt-get install oracle-java8-installer + +# Clone java-stix repo at the current branch into the container +COPY . java-stix + +# Open the java-stix project +WORKDIR java-stix + +# Build unsigned jar archives in debug to /java-stix/build/libs +RUN ./gradlew -x signArchives -d + +# Clean up APT when done. +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/README.MD b/README.MD index 0be8f16..ccdf716 100644 --- a/README.MD +++ b/README.MD @@ -1,13 +1,13 @@ # java-stix -The Java bindings for STIX, the Structured Threat Information eXpression +The Java bindings for STIX, the Structured Threat Information eXpression language used for representing structured cyber threat information. java-stix is being developed under the official [STIXProject][stix project] For more information, see [http://stix.mitre.org/][stix]. -[![Circle CI](https://circleci.com/gh/STIXProject/java-stix.svg?style=svg)](https://circleci.com/gh/STIXProject/java-stix) [![Build Status](https://travis-ci.org/STIXProject/java-stix.svg)](https://travis-ci.org/STIXProject/java-stix) [![Code Climate](https://codeclimate.com/github/STIXProject/java-stix/badges/gpa.svg)](https://codeclimate.com/github/STIXProject/java-stix) [![Test Coverage](https://codeclimate.com/github/STIXProject/java-stix/badges/coverage.svg)](https://codeclimate.com/github/STIXProject/java-stix/coverage) +[![Circle CI](https://circleci.com/gh/STIXProject/java-stix.svg?style=svg)](https://circleci.com/gh/STIXProject/java-stix) [![Build Status](https://travis-ci.org/STIXProject/java-stix.svg)](https://travis-ci.org/STIXProject/java-stix) ## Overview @@ -22,7 +22,11 @@ replacement for the [python-stix][python stix] API. Releases of java-stix will comply with the Semantic Versioning specification at [http://semver.org/][semver]. Java-stix is currently under active development; see TODO.txt for a tentative roadmap. Releases will be announced on the [STIX -discussion list][list]. +discussion list][list]. A java-stix for a particular schema release will match the +STIX schema version in Semantic Versioning form. Follow up patches of java-stix +for a particular schema release will increment a 4th digit. For example, the first +patch release for java-stix `v1.2.0` would be `v1.2.0.1`. Patches will be worked +in a branch prior to being tagged and released. ## Releases @@ -33,16 +37,16 @@ Releases are distributed via the Maven Central Repository. org.mitre stix - 1.2.0 + 1.2.0.1 ### Gradle: - compile 'org.mitre:stix:1.2.0' + compile 'org.mitre:stix:1.2.0.1' ### Apache Ivy: - + ## Snapshots @@ -65,7 +69,7 @@ Users using Apache Maven for example can simply retrieve java-stix directly via org.mitre stix - 1.2.0-SNAPSHOT + 1.2.0.1-SNAPSHOT @@ -148,23 +152,26 @@ commands on the command line: git submodule update --force cd src/main/resources/schemas/v1.2.0 git checkout tags/v1.2.0 - + Your not done. You'll also need to retrieve the CybOX schemas. ### The CybOX schemas While in the project: + cd src/main/resources/schemas/v1.2.0 git submodule init git submodule update --force - git checkout 3442ebe50385d3bd0b3305952b90d296e0a1242c + cd cybox + git checkout 97beb32c376a9223e91b52cb3e4c8d2af6baf786 When Gradle build script first runs it will also patch the CybOX schemas so that the JAXB2 Simple Document Object Model can be generated. Once patched, it will remained patched locally. If Gradle fails to retrieve the schemas, you will need to patch the schemas by hand from the command-line. The patch file, `cybox_object_archive_object_patch` is in the root of the project. NetBeans -can also apply patches via `Team` -> `Patches` -> `Apply Diff Patch`. +can also apply patches via +`Team` -> `Patches` -> `Apply Diff Patch`. ## Creating the JAXB2 Document Object Model @@ -208,32 +215,34 @@ on UNIX: :generatedSourceTransformation :createPackageInfo :compileJava + warning: [options] bootstrap class path not set in conjunction with -source 1.7 Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. + 1 warning :compileGroovy UP-TO-DATE :processResources :classes :jar :javadoc /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:277: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:287: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:349: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:319: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:339: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:361: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:341: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:311: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:331: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:277: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:287: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:319: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:339: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:349: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:311: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:331: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:341: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:361: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/SPKIData.java:115: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/X509Data.java:132: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/X509Data.java:132: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/X509Data.java:132: warning - Tag @link: reference not found: byte[] /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:277: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:287: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:349: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:319: warning - Tag @link: reference not found: byte[] - /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:339: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:361: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:341: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:311: warning - Tag @link: reference not found: byte[] + /Users/walsh/Development/workspace/java_stix/src/generated/java/org/w3/_2000/_09/xmldsig/ObjectFactory.java:331: warning - Tag @link: reference not found: byte[] 19 warnings :javadocJar :sourcesJar @@ -248,7 +257,7 @@ on UNIX: BUILD SUCCESSFUL - Total time: 6 mins 23.329 secs + Total time: 3 mins 45.121 secs Ignore the javadoc tag warnings they have no impact on the build. Also, ignore the warning about unchecked or unsafe operations as they are an artifact of @@ -281,7 +290,7 @@ path. To execute the tests: - ./gradlew -x signArchives test + /gradlew -x signArchives test Consider using `-d`/`--debug` or `-i`/`--info` for more details during test execution like so: @@ -318,11 +327,11 @@ this platform. You will need additional dependencies normally found in UNIX, such as, GNU patch. GNU Patch can be installed via either cygwin, Chocolatey, or directly. Then you'll need to work out permission elevation issues so Gradle can execute the command-line GNU patch command through Gradle's Ant -integration. +integration. Alternatively, see the section on [building using the Dockerfile](#building_via_docker). To build on Windows use the gradlew batch script like so: - .\gradlew.bat -x signArchives + $ .\gradlew.bat -x signArchives If the build goes well you will find the jars: @@ -333,6 +342,36 @@ If the build goes well you will find the jars: where `${version}` is replaced with the `version` number in the Gradle build script. +### Building via the Dockerfile + +If you have Docker installed, from the root of the project run +the following to create a container image for this Dockerfile via: + + docker build -t java_stix_img_v1_2_0_1 . + +Then create a container using the image you just created via: + + docker run -t -i java_stix_img_v1_2_0_1 /bin/bash + +To retreive the jar archives from the running docker container use following +from the command-line of your docker host, not the container: + + docker cp :/java-stix/build/libs/stix-1.2.0.1-SNAPSHOT-javadoc.jar . + docker cp :/java-stix/build/libs/stix-1.2.0.1-SNAPSHOT-sources.jar . + docker cp :/java-stix/build/libs/stix-1.2.0.1-SNAPSHOT.jar . + +If the containder ID is not obvious, but you can also retrieve it via: + + docker ps + +An example of retrieving the snapshot jar would be the following: + + docker cp 83ad9afb6096:/java-stix/build/libs/stix-1.2.0.1-SNAPSHOT.jar . + +By default the Docker container will build using OpenJdk 7. You can modify +the Dockerfile to other JVM's noted in the file. Please, note Gradle targets +Java 1.7 compatibility regardless. + ### Importing the project into Eclipse As Eclipse's various Gradle plugins have varying degrees of usefulness, I diff --git a/build.gradle b/build.gradle index c7afb70..bcb5c09 100644 --- a/build.gradle +++ b/build.gradle @@ -65,8 +65,6 @@ apply plugin: "signing" defaultTasks "build" -project.ext.set("schemaVersion", version) - if (!has("release")) { version = "${version}-SNAPSHOT" } @@ -103,6 +101,13 @@ if (!has("skipPackageInfo")) { task wrapper(type: Wrapper) { gradleVersion = '2.4' + def jvmOpts='-Xmx1024m -Xms256m' + inputs.property("jvmOpts", jvmOpts) + doLast { + def optsEnvVar = "DEFAULT_JVM_OPTS" + scriptFile.write scriptFile.text.replace("$optsEnvVar=\"\"", "$optsEnvVar=\"$jvmOpts\"") + batchScript.write batchScript.text.replace("set $optsEnvVar=", "set $optsEnvVar=$jvmOpts") + } } task javadocJar(type: Jar) { @@ -133,6 +138,11 @@ task execute(type:JavaExec) { classpath = sourceSets.main.runtimeClasspath } +task gatherDependencies(type: Copy) { + into "${buildDir}/dependencies" + from configurations.runtime +} + uploadArchives{ configuration = configurations.archives repositories { @@ -232,6 +242,7 @@ sourceSets { resources { srcDir("src/main/resources") exclude "*.xjb" + exclude "**/v1.2-rc1" exclude "**/v1.1.1" } } @@ -260,6 +271,7 @@ dependencies { testCompile "org.codehaus.groovy:groovy:2.4.3" testCompile "org.spockframework:spock-core:1.0-groovy-2.4" testCompile "xmlunit:xmlunit:1.6" + testCompile "com.github.zafarkhaja:java-semver:0.9.0" } jar { @@ -313,6 +325,11 @@ artifacts { archives javadocJar } +tasks.withType(JavaCompile) { + sourceCompatibility = "1.7" + targetCompatibility = "1.7" +} + buildscript { repositories { jcenter() diff --git a/circle.yml b/circle.yml index 694bb8d..be88d48 100644 --- a/circle.yml +++ b/circle.yml @@ -7,4 +7,4 @@ machine: test: override: - - ./gradlew -x signArchives \ No newline at end of file + - ./gradlew -x signArchives diff --git a/gradle.properties b/gradle.properties index dedf6ad..f6d4bb2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,5 @@ -version = 1.2.0 +version = 1.2.0.1 +schemaVersion = 1.2.0 group = org.mitre name = stix mainClass = org.mitre.stix.STIXSchema \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 085a1cd..b5166da 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0fcaf33..dbc7d44 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 27 15:56:20 EDT 2015 +#Mon Jun 22 14:56:06 EDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip diff --git a/gradlew b/gradlew index 745c3a5..8c1075e 100755 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ ############################################################################## # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="-Dorg.gradle.daemon=true -Xmx1024m -Xms256m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError" +DEFAULT_JVM_OPTS="-Xmx1024m -Xms256m" APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` @@ -161,4 +161,4 @@ function splitJvmOpts() { eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain $CI_OPTS "$@" +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat index f4679dd..c750a85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -9,7 +9,7 @@ if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Dorg.gradle.daemon=true -Xmx1024m -Xms256m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError" +set DEFAULT_JVM_OPTS=-Xmx1024m -Xms256m set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. @@ -72,7 +72,7 @@ set CMD_LINE_ARGS=%$ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CI_OPTS% %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/org/mitre/stix/STIXSchema.java b/src/main/java/org/mitre/stix/STIXSchema.java index 55e1c22..f3b926e 100644 --- a/src/main/java/org/mitre/stix/STIXSchema.java +++ b/src/main/java/org/mitre/stix/STIXSchema.java @@ -40,6 +40,7 @@ import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; /** @@ -87,12 +88,13 @@ private STIXSchema() { this.version = ((Version) this.getClass().getPackage() .getAnnotation(Version.class)).schema(); - ResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver(); + ResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver( + this.getClass().getClassLoader()); Resource[] schemaResources; try { schemaResources = patternResolver - .getResources("classpath*:schemas/v" + version + .getResources("classpath:schemas/v" + version + "/**/*.xsd"); prefixSchemaBindings = new HashMap(); @@ -166,6 +168,16 @@ private STIXSchema() { } } + /** + * Override the default ValidationErrorHandler with one of your own. + * + * @param customErrorHandler + * The Handler to use instead. + */ + public void setValidationErrorHandler(ErrorHandler customErrorHandler) { + validator.setErrorHandler(customErrorHandler); + } + /** * Returns the schema version * @@ -243,6 +255,7 @@ public boolean validate(String xmlText) { } catch (IOException e) { throw new RuntimeException(e); } catch (SAXException e) { + System.out.println("---------\n" + e + "--------\n"); return false; } @@ -268,8 +281,8 @@ public static void main(String[] args) throws ParserConfigurationException, System.out .println(schema .validate(new URL( - "https://raw.githubusercontent.com/STIXProject/schemas/master/samples/STIX_Domain_Watchlist.xml"))); - + "https://raw.githubusercontent.com/STIXProject/python-stix/v1.2.0.0/examples/sample.xml"))); + System.out.println(schema.getVersion()); } @@ -298,11 +311,9 @@ public static String getNamespaceURI(Object obj) { */ public static String getName(Object obj) { try { - return obj.getClass().getAnnotation( - XmlRootElement.class).name(); + return obj.getClass().getAnnotation(XmlRootElement.class).name(); } catch (NullPointerException e) { - return obj.getClass().getAnnotation( - XmlType.class).name(); + return obj.getClass().getAnnotation(XmlType.class).name(); } } diff --git a/src/main/java/org/mitre/stix/examples/CIQIdentity.java b/src/main/java/org/mitre/stix/examples/CIQIdentity.java index 307c779..702312a 100644 --- a/src/main/java/org/mitre/stix/examples/CIQIdentity.java +++ b/src/main/java/org/mitre/stix/examples/CIQIdentity.java @@ -172,7 +172,7 @@ public static void main(String[] args) { STIXPackage stixPackage = new STIXPackage() .withSTIXHeader(header) .withIndicators(indicators) - .withVersion("1.1.1") + .withVersion("1.2") .withTimestamp(now) .withId(new QName("http://example.com/", "package-" + UUID.randomUUID().toString(), "example")); diff --git a/src/main/java/org/mitre/stix/examples/CreationToolMetadata.java b/src/main/java/org/mitre/stix/examples/CreationToolMetadata.java index 93473a7..da3a5e6 100644 --- a/src/main/java/org/mitre/stix/examples/CreationToolMetadata.java +++ b/src/main/java/org/mitre/stix/examples/CreationToolMetadata.java @@ -56,7 +56,7 @@ public static void main(String[] args) { STIXPackage stixPackage = new STIXPackage() .withSTIXHeader(header) - .withVersion("1.1.1") + .withVersion("1.2") .withTimestamp(now) .withId(new QName("http://example.com/", "package-" + UUID.randomUUID().toString(), "example")); diff --git a/src/main/java/org/mitre/stix/examples/IndicatorHash.java b/src/main/java/org/mitre/stix/examples/IndicatorHash.java index d24b974..1a04ed9 100644 --- a/src/main/java/org/mitre/stix/examples/IndicatorHash.java +++ b/src/main/java/org/mitre/stix/examples/IndicatorHash.java @@ -116,7 +116,7 @@ public static void main(String[] args) { STIXPackage stixPackage = new STIXPackage() .withSTIXHeader(stixHeader) .withIndicators(indicators) - .withVersion("1.1.1") + .withVersion("1.2") .withTimestamp(now) .withId(new QName("http://example.com/", "package-" + UUID.randomUUID().toString(), "example")); diff --git a/src/test/groovy/org/mitre/stix/DocumentUtilitiesSpec.groovy b/src/test/groovy/org/mitre/stix/DocumentUtilitiesSpec.groovy index 154a2e8..ca80d35 100644 --- a/src/test/groovy/org/mitre/stix/DocumentUtilitiesSpec.groovy +++ b/src/test/groovy/org/mitre/stix/DocumentUtilitiesSpec.groovy @@ -28,7 +28,7 @@ import spock.lang.* class DocumentUtilitiesSpec extends spock.lang.Specification{ - @Shared def version = "1.1.1" + @Shared def version = "1.2" @Shared def controlXML = """ """ when: "A STIXPackage is created, converted to Document representation, and then serialize to an XML String" - def version = "1.1.1" + def version = "1.2" def c = new GregorianCalendar(TimeZone.getTimeZone("UTC")) c.setTimeInMillis(0)