SHARE
TWEET

Untitled

a guest Jun 8th, 2017 19 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. apply plugin: 'java'
  2. apply plugin: 'maven-publish'
  3.  
  4. dependencies {
  5.     compile 'javax.json:javax.json-api:1.0'
  6.     compile 'org.glassfish:javax.json:1.0.4'
  7.     testCompile 'junit:junit:4.11'
  8.     compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
  9. }
  10.  
  11. task sourceJar(type: Jar, dependsOn: classes) {
  12.     from sourceSets.main.allJava
  13. }
  14.  
  15. task javaDocJar(type: Jar, dependsOn: javadoc) {
  16.     from javadoc.destinationDir
  17. }
  18.  
  19. publishing {
  20.     publications {
  21.         mavenJava(MavenPublication) {
  22.             artifactId project.artifactId
  23.  
  24.             from components.java
  25.  
  26.             artifact sourceJar {
  27.                 classifier "sources"
  28.             }
  29.  
  30.             artifact javaDocJar {
  31.                 classifier "javadoc"
  32.             }
  33.         }
  34.     }
  35.    
  36.     repositories {
  37.         maven {
  38.             def optionalSnapshot = project.version.endsWith('-SNAPSHOT') ? "-snapshots" : ""
  39.             url "http://repoproxy.idainfront.se/repository/internal${optionalSnapshot}/"
  40.             credentials {
  41.                 def console = System.console()
  42.                 if (console) {
  43.                     username = console.readLine('> Please enter your username: ')
  44.                     password = console.readPassword('> Please enter your password: ')
  45.                 } else {
  46.                     logger.error "Cannot get console."
  47.                 }
  48.             }
  49.         }
  50.     }
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top