HIRS/HIRS_Structs/build.gradle

105 lines
3.0 KiB
Groovy

apply plugin: 'java'
apply plugin: 'checkstyle'
// DONT DELETE the next two plugins, maven and signing.
// They're used for maven publishing.
// But can cause build issues if certain gradle.properties are not set.
//apply plugin: 'maven'
//apply plugin: 'signing'
sourceCompatibility = 1.8
dependencies {
compile libs.commons_lang
testCompile libs.mockito
testCompile libs.testng
}
ext.configDir = new File(projectDir, 'config')
ext.checkstyleConfigDir = "$configDir/checkstyle"
checkstyle {
toolVersion = '8.45.1'
configFile = checkstyleConfigFile
configProperties.put('basedir', checkstyleConfigDir)
ignoreFailures = false
showViolations = true
}
publishing {
publications {
maven(MavenPublication) {
artifactId 'hirs-structs'
from components.java
}
}
}
// Maven packaging and signing
group = 'io.github.nsacyber.hirs'
version = '1.1.1'
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_Structs'
packaging 'jar'
// optionally artifactId can be defined here
description 'Basic structures 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)
}
}
}
}