plugins { id 'java' id 'maven-publish' id 'com.jfrog.bintray' version '1.8.4' } group = 'com.snowplowanalytics' archivesBaseName = 'java-referer-parser' version = '0.4.0' sourceCompatibility = '1.8' targetCompatibility = '1.8' repositories { mavenCentral() } dependencies { compile 'org.yaml:snakeyaml:1.19' compile 'org.apache.httpcomponents:httpclient:4.5.3' testCompile 'junit:junit:4.12' testCompile 'org.json:json:20180813' } bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_API_KEY') pkg { repo = 'snowplow-maven' name = archivesBaseName licenses = ['Apache-2.0'] vcsUrl = 'https://github.com/snowplow-referer-parser/java-referer-parser.git' } publications = ['mavenJava'] version { name = version gpg { sign = true } mavenCentralSync { sync = true user = System.getenv('SONA_USER') password = System.getenv('SONA_PASS') } } } task javadocJar(type: Jar) { classifier = 'javadoc' from javadoc } task sourcesJar(type: Jar) { classifier = 'sources' from sourceSets.main.allSource } def pomConfig = { 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 'alexanderdean' name 'Alexander Dean' email 'alex@snowplowanalytics.com' } } scm { connection 'https://github.com/snowplow-referer-parser/java-referer-parser.git' developerConnection 'https://github.com/snowplow-referer-parser/java-referer-parser.git' url 'https://github.com/snowplow-referer-parser/java-referer-parser' } } // Create the publication with the pom configuration: publishing { publications { mavenJava(MavenPublication) { from components.java artifact sourcesJar artifact javadocJar groupId group artifactId 'java-referer-parser' version version pom.withXml { def root = asNode() root.appendNode('description', 'This is the Java implementation of referer-parser, the library for extracting attribution data from referer (sic) URLs.') root.appendNode('name', 'Java Referer Parser') root.appendNode('url', 'https://github.com/snowplow-referer-parser/java-referer-parser') root.children().last() + pomConfig } } } }