2018-09-06 13:47:33 +00:00
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
apply plugin: 'findbugs'
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'jacoco'
|
|
|
|
apply plugin: 'pmd'
|
2023-07-26 14:44:39 +00:00
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'signing'
|
2018-09-06 13:47:33 +00:00
|
|
|
|
|
|
|
ext.configDir = new File(projectDir, 'config')
|
|
|
|
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
integrationTest {
|
|
|
|
java.srcDir file('src/integration/java')
|
|
|
|
compileClasspath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime
|
|
|
|
runtimeClasspath = output + compileClasspath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task utilsTestJar(type: Jar) {
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile libs.gson // required for plugin
|
|
|
|
compile libs.bouncy_castle
|
|
|
|
compile libs.commons_cli
|
|
|
|
compile libs.commons_codec
|
|
|
|
compile libs.commons_csv
|
|
|
|
compile libs.commons_exec
|
|
|
|
compile libs.commons_io
|
|
|
|
compile libs.commons_lang
|
|
|
|
compile libs.commons_valid
|
|
|
|
compile libs.hibernate
|
|
|
|
compile libs.hikari
|
|
|
|
compile libs.jackson
|
|
|
|
compile libs.jadira_usertype
|
|
|
|
compile libs.joda_time
|
|
|
|
compile libs.log4j2
|
|
|
|
compile libs.mariadb
|
2021-12-03 21:01:04 +00:00
|
|
|
compile libs.pci_ids
|
2018-09-06 13:47:33 +00:00
|
|
|
compile libs.reflections
|
|
|
|
compile libs.guava
|
|
|
|
compile libs.spring_core
|
|
|
|
compile libs.spring_retry
|
2019-03-25 15:14:19 +00:00
|
|
|
compile libs.minimal_json
|
2018-09-06 13:47:33 +00:00
|
|
|
compile 'org.jboss.logging:jboss-logging:3.2.0.Final'
|
2023-07-26 14:11:31 +00:00
|
|
|
compile 'org.apache.commons:commons-text:1.10.0'
|
2018-09-06 13:47:33 +00:00
|
|
|
|
|
|
|
// add spring plugin, but do not pull transitive dependencies (causes conflicts)
|
|
|
|
compile(libs.spring_plugin) {
|
|
|
|
exclude group: "org.springframework"
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOnly libs.checkstyle
|
|
|
|
compileOnly libs.findbugs
|
|
|
|
|
|
|
|
runtime fileTree(dir: 'build/plugins', include: ['*.jar'])
|
|
|
|
|
|
|
|
testCompile libs.spring_test
|
|
|
|
testCompile libs.hsqldb
|
|
|
|
testCompile libs.jcommander
|
|
|
|
testCompile libs.mockito
|
|
|
|
testCompile libs.powermock
|
|
|
|
testCompile libs.testng
|
|
|
|
testCompile libs.checkstyle
|
|
|
|
testCompile libs.findbugs
|
|
|
|
testCompile libs.commons_lang
|
|
|
|
}
|
|
|
|
|
2020-10-01 12:36:59 +00:00
|
|
|
task generateXjcLibrary(type:Exec) {
|
|
|
|
workingDir 'config'
|
|
|
|
|
|
|
|
commandLine './genXjcLibrary.sh'
|
|
|
|
}
|
|
|
|
|
|
|
|
compileJava.dependsOn generateXjcLibrary
|
|
|
|
|
2018-09-06 13:47:33 +00:00
|
|
|
task importBaseline(type:JavaExec) {
|
|
|
|
description 'Imports Baselines into the database'
|
|
|
|
main = "hirs.persist.ImportCLI"
|
|
|
|
if (project.hasProperty("mainArgs") ) {
|
|
|
|
args mainArgs.split()
|
|
|
|
}
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
task integrationTest(type: Test) {
|
|
|
|
testClassesDir = sourceSets.integrationTest.output.classesDir
|
|
|
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.checkstyleConfigDir = "$configDir/checkstyle"
|
|
|
|
|
|
|
|
checkstyle {
|
2023-07-25 19:19:57 +00:00
|
|
|
toolVersion = '8.45.1'
|
2018-09-06 13:47:33 +00:00
|
|
|
configFile = checkstyleConfigFile
|
|
|
|
configProperties.put('basedir', checkstyleConfigDir)
|
|
|
|
ignoreFailures = false
|
|
|
|
showViolations = true
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.findbugsConfigDir = "$configDir/findbugs"
|
|
|
|
|
|
|
|
findbugs {
|
|
|
|
toolVersion = '3.0.0'
|
|
|
|
ignoreFailures = false
|
|
|
|
effort = 'max'
|
|
|
|
excludeFilter = new File(findbugsConfigDir, 'suppressions.xml')
|
|
|
|
}
|
|
|
|
|
2020-10-01 12:36:59 +00:00
|
|
|
pmdMain {
|
|
|
|
exclude '**/xjc/**'
|
|
|
|
}
|
|
|
|
|
2018-09-06 13:47:33 +00:00
|
|
|
jacocoTestReport {
|
|
|
|
reports {
|
|
|
|
xml.enabled true
|
|
|
|
csv.enabled true
|
|
|
|
html.enabled true
|
|
|
|
html.destination "${buildDir}/reports/jacoco/html"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
artifactId 'hirs-utils'
|
|
|
|
from components.java
|
|
|
|
}
|
|
|
|
testResources(MavenPublication) {
|
|
|
|
artifactId 'hirs-utils-test'
|
|
|
|
artifact utilsTestJar
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-12 01:11:32 +00:00
|
|
|
// Maven packaging and signing
|
|
|
|
group = 'io.github.nsacyber.hirs'
|
2023-07-27 19:42:50 +00:00
|
|
|
version = '2.2.0'
|
2023-07-26 14:44:39 +00:00
|
|
|
project.gradle.taskGraph.whenReady { graph ->
|
|
|
|
project.tasks.findAll().forEach { task ->
|
|
|
|
if (task.name.contains("signArchives") || task.name.contains("uploadArchives")) {
|
|
|
|
// If this is set to true, the signing and maven
|
|
|
|
// properties in gradle.properties must be set.
|
|
|
|
task.enabled = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-12 01:11:32 +00:00
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
failOnError false
|
|
|
|
}
|
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc
|
|
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives javadocJar, sourcesJar
|
|
|
|
}
|
|
|
|
|
|
|
|
signing {
|
|
|
|
sign configurations.archives
|
|
|
|
}
|
|
|
|
|
|
|
|
uploadArchives {
|
|
|
|
repositories {
|
|
|
|
mavenDeployer {
|
|
|
|
pom.project {
|
|
|
|
name 'HIRS_Utils'
|
|
|
|
packaging 'jar'
|
|
|
|
// optionally artifactId can be defined here
|
|
|
|
description 'Core utilities for the HIRS ACA.'
|
|
|
|
url 'https://github.com/nsacyber/hirs'
|
|
|
|
|
|
|
|
scm {
|
|
|
|
connection 'scm:git:git://github.com:nsacyber/hirs.git'
|
|
|
|
developerConnection 'scm:git:git://github.com:nsacyber/hirs.git'
|
|
|
|
url 'https://github.com/nsacyber/hirs'
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'The Apache Software License, Version 2.0'
|
|
|
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id 'iadgovuser29'
|
|
|
|
name 'iadgovuser29'
|
|
|
|
email '33426478+iadgovuser29@users.noreply.github.com'
|
|
|
|
organization 'NSA Cybersecurity Directorate'
|
|
|
|
organizationUrl 'https://github.com/nsacyber'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
|
|
|
|
|
|
repository(url: "https://${sonatypeDomain}/service/local/staging/deploy/maven2/") {
|
|
|
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
|
|
|
}
|
|
|
|
snapshotRepository(url: "https://${sonatypeDomain}/content/repositories/snapshots/") {
|
|
|
|
authentication(userName: ossrhUsername, password: ossrhPassword)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|