Skip to content

Commit

Permalink
Release version 1.1.0
Browse files Browse the repository at this point in the history
Changed build to name target appropriately.
  • Loading branch information
jasenj1 committed Jun 18, 2015
1 parent eff14da commit 8690b1e
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ jdk:
- oraclejdk8
- oraclejdk7

# the below keeps 'gradle assemble' from being called which tries to sign the jars.
install: /bin/true

script: "gradle test"

notifications:
email:
- taxii-commits-list@lists.mitre.org
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
A Java library for handling TAXII Messages and invoking TAXII Services.
For more information, see http://taxii.mitre.org/.

[![Build Status](https://travis-ci.org/TAXIIProject/java-taxii.svg?branch=master)](https://travis-ci.org/TAXIIProject/java-taxii)

## Overview

A primary goal of java-taxii is to remain faithful to both the TAXII
Expand Down Expand Up @@ -54,4 +56,4 @@ systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

You are encouraged to provide feedback by commenting on open issues or
signing up for the [TAXII discussion list](http://taxii.mitre.org/community/registration.html)
and posting your questions.
and posting your questions.
162 changes: 141 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, The MITRE Corporation. All rights reserved.
* Copyright (c) 2015, The MITRE Corporation. All rights reserved.
* See LICENSE for complete terms.
*
* Java-TAXII Gradle Buildscript
Expand All @@ -10,19 +10,27 @@
*
* gradle
*
* from the commnand-line.
* from the commnand-line will default to "gradle jar".
*
* Jar will be built to
*
* build/libs/java-taxii-${version}.jar
*/

defaultTasks 'test'

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'signing'

defaultTasks 'jar'

version = 1.1
version = "1.1.0"
// version = "0.1"
group = "org.mitre.taxii"
archivesBaseName = "taxii"

// def isReleaseVersion = !version.endsWith("SNAPSHOT")
def taxiiSchemaVersion = "1.1 & 1.0"

String srcGeneratedDir = 'src/generated'
String srcGeneratedJavaDir = srcGeneratedDir + '/java'
Expand Down Expand Up @@ -55,7 +63,7 @@ dependencies {
xjc 'com.sun.xml.bind:jaxb-impl:2.2.5-2'
xjc 'javax.xml:jsr173:1.0'
xjc 'stax:stax-api:1.0.1'
xjc 'javax.xml.bind:jaxb-api:2.2.+'
xjc 'javax.xml.bind:jaxb-api:2.2.11'
xjc 'com.sun.xml.bind:jaxb-xjc:2.2.5-2'

// use the JAXB2 Commons project to include some XJC plugins
Expand All @@ -71,44 +79,51 @@ dependencies {
// with XML namespace URIs.
xjc 'org.jvnet.jaxb2_commons:jaxb2-namespace-prefix:1.1'

compile 'javax.xml.bind:jaxb-api:2.2.+'
compile 'javax.xml.bind:jaxb-api:2.2.11'
compile 'org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.5'
compile 'net.sf.saxon:Saxon-HE:9.5.1-5'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'org.apache.httpcomponents:httpclient-cache:4.3.5'
compile 'org.apache.httpcomponents:httpmime:4.3.5'
compile 'org.apache.httpcomponents:fluent-hc:4.3.5'

testCompile 'junit:junit:4.11'
}

if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
// disable strict doclint in Java 8
options.addStringOption('Xdoclint:none', '-quiet')
}
}

task retrieveSchemas << {
if (project.fileTree(schemasDir).isEmpty()) {
// Get the schemas & patch them.
println "Retrieving TAXII schemas from reference sources."

ant.mkdir(dir:schemasDir)
/*
* TODO:
* As of this writing, the official schemas on the TAXII web site do not include the Schematron rules, so
* get the schemas from a local directory. Once the official schemas have been modified, the below should be
* pointed at the official schemas.
*
* NOTE: The patch files will ned to be updated once new versions are posted to the web site.
*/
/*
* TODO:
* As of this writing, the official schemas on the TAXII web site do not include the Schematron rules, so
* get the schemas from a local directory. Once the official schemas have been modified, the below should be
* pointed at the official schemas.
*
* NOTE: The patch files will ned to be updated once new versions are posted to the web site.
*/
// Get the TAXII 1.1 Schema.
def schemaSource = new File(project.rootDir.absolutePath + "/" + "schemas" + "/TAXII_XMLMessageBinding_Schema-1.1-with-sch.xsd")
// URL schemaSource = new URL("https://raw.githubusercontent.com/TAXIIProject/TAXII-Specifications/1.1/TAXII_XMLMessageBinding_Schema.xsd")
// URL schemaSource = new URL("https://raw.githubusercontent.com/TAXIIProject/TAXII-Specifications/1.1/TAXII_XMLMessageBinding_Schema.xsd")
File outFile = new File(project.rootDir.absolutePath + "/" + schemasDir + "/TAXII_XMLMessageBinding-1.1.xsd")
outFile.write(schemaSource.getText())

// Get the TAXII 1.0 Schema.
schemaSource = new File(project.rootDir.absolutePath + "/" + "schemas" + "/TAXII_XMLMessageBinding_Schema-1.0-with-sch.xsd")
// taxiiUrl = new URL("https://raw.githubusercontent.com/TAXIIProject/TAXII-Specifications/1.0/TAXII_XMLMessageBinding_Schema.xsd")
// taxiiUrl = new URL("https://raw.githubusercontent.com/TAXIIProject/TAXII-Specifications/1.0/TAXII_XMLMessageBinding_Schema.xsd")
outFile = new File(project.rootDir.absolutePath + "/" + schemasDir + "/TAXII_XMLMessageBinding-1.0.xsd")
outFile.write(schemaSource.getText())

// TODO: The following two schemas are already in a form we can pull from their web site.
// TODO: The following two schemas are already in a form we can pull from their web site.

// Get the DefaultQuery Schema.
schemaSource = new URL("https://raw.githubusercontent.com/TAXIIProject/TAXII-Specifications/1.1/TAXII_DefaultQuery_Schema.xsd")
Expand Down Expand Up @@ -158,7 +173,7 @@ task generate << {

ant.mkdir(dir: srcGeneratedJavaDir)
ant.xjc(destdir: srcGeneratedJavaDir, header: false, readonly: true,
extension: true, classpath: configurations.xjc.asPath) {
extension: true, classpath: configurations.xjc.asPath) {

arg(line: '-Xequals -XhashCode -Xfluent-api -Xvalue-constructor -Xdefault-value -Xnamespace-prefix')
binding(dir: bindingDir, includes: '*.xjb')
Expand All @@ -171,14 +186,119 @@ task cleanGenerated << {
ant.delete(dir: srcGeneratedDir)
}

jar {
manifest {
attributes 'Specification-Title': 'Trusted Automated Exchange of Indicator Information (TAXII)',
'Specification-Version': '1.1 & 1.0',
'Implementation-Title': 'Java-TAXII',
'Implementation-Version': version,
'Implementation-Vendor': 'The MITRE Corporation'
}
from 'LICENSE'
}

javadoc {
options.overview = "src/main/java/overview.html"
options.showAll()
options.encoding("UTF-8")
options.setUse(true)
options.author(true)
options.version(true)
options.windowTitle("java-taxii v." + version)
options.docTitle("java-taxii v." + version)
options.footer("Copyright (c) 2015, The MITRE Corporation. All rights reserved.")

doFirst {
javadoc.title = "java-taxii v." + version
javadoc.options.docTitle = javadoc.title
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'LICENSE'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from 'LICENSE'
from 'README.md'
from sourceSets.main.allSource
}

artifacts {
archives jar, sourcesJar, javadocJar
}

signing {
sign configurations.archives
}


uploadArchives {

repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment ->
signing.signPom(deployment)
}

def username = project.hasProperty('ossrhUsername') ? ossrhUsername : false
def password = project.hasProperty('ossrhPassword') ? ossrhPassword : false

if (username && password) {
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: username, password: password)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: username, password: password)
}
} else {
repository(url: "file://${project.projectDir}/build/artifacts/")
snapshotRepository(url: "file://${project.projectDir}/build/artifacts/snapshots/")
}


pom.project {
name 'taxii'
packaging 'jar'
// version "${project.version}" - version handled automatically.
// optionally artifactId can be defined here
description "The JAXB Bindings for TAXII v." + version
url "https://github.com/TAXIIProject/java-taxii"

scm {
connection "https://github.com/TAXIIProject/java-taxii.git"
developerConnection "https://github.com/TAXIIProject/java-taxii.git"
url "https://github.com/TAXIIProject/"
}

licenses {
license {
name "The BSD 3-Clause License"
url "https://raw.githubusercontent.com/TAXIIProject/java-taxii/master/LICENSE.txt"
}
}

developers {
developer {
id 'taxii'
name 'TAXII Team'
email 'taxii[ASCII character number 64]mitre.org'
}
}
} // pom.project

}
}
}

task dist << {
ant.zip(destfile: "build/java-taxii.zip") {
fileset(dir: ".", includes: "README.txt, LICENSE.txt")
fileset(dir: "build/libs", includes: "java-taxii-${version}.jar")
fileset(dir: "build/libs", includes: "taxii-${version}.jar")
}
}

Expand Down

0 comments on commit 8690b1e

Please sign in to comment.