apply plugin: 'java' apply plugin: 'checkstyle' 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 = '2.2.0' 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 } } } 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) } } } }