Guest User

init.gradle

a guest
Nov 16th, 2012
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rootProject{
  2.     def eci_ears_dir = "/ears"
  3.     def earArtifactsList = []
  4.    
  5.     artifacts {
  6.         new File(eci_ears_dir).eachFileMatch(~/.*.ear/) {fileEar ->
  7.             archives file: file(fileEar.getAbsolutePath()), name: fileEar.getName().replaceAll(".ear",""), type: 'ear'
  8.             earArtifactsList.add(fileEar.getName().replaceAll(".ear",""))
  9.         }
  10.     }
  11.    
  12.     rootProject.group = "com.myproject"
  13.     rootProject.version = "0.1-SNAPSHOT"
  14.  
  15.     uploadArchives{
  16.         repositories {
  17.             mavenDeployer {
  18.                 uniqueVersion = false
  19.                 name = 'earsUploas'
  20.                 repository(id: "ears",url: "${mavenRepositoryReleasesUrl}"){
  21.                     authentication(userName: mavenCredentialsUser, password: mavenCredentialsPassword)
  22.                 }
  23.                 snapshotRepository(id: "ears-snapshots",url: "${mavenRepositorySnapshotsUrl}"){
  24.                     authentication(userName: mavenCredentialsUser, password: mavenCredentialsPassword)
  25.                 }
  26.  
  27.                 earArtifactsList.each { earName ->
  28.                     addFilter(earName) {artifact, file ->
  29.                         artifact.name == earName
  30.                     }
  31.                     pom(earName).artifactId = earName
  32.                     pom(earName).groupId = "${rootProject.group}"
  33.                     pom(earName).version = "${rootProject.version}"
  34.                 }
  35.             }
  36.         }
  37.     }
  38. }
RAW Paste Data