ddineshk

build.gradle

Mar 26th, 2015
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.45 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         maven { url "http://myorgart:8780/artifactory/libs-release" }
  4.     }
  5.     dependencies {
  6.         classpath 'com.bmuschko:gradle-cargo-plugin:2.0.3'
  7.     }
  8. }
  9.  
  10. apply plugin: 'java'
  11. apply plugin: 'war'
  12. apply plugin: 'com.bmuschko.cargo'
  13. apply plugin: 'com.bmuschko.cargo-base'
  14.  
  15. ext {
  16.   artifactoryUrl = 'http://myorgart:8780/artifactory'
  17.   deployment_username = project.hasProperty('deployment_username') ? project.deployment_username : 'dummy'
  18.   deployment_password = project.hasProperty('deployment_password') ? project.deployment_password : 'bogus'  
  19. }
  20.  
  21. group = 'com.myorg.usr'
  22. archivesBaseName = 'myfile'
  23. version = '1.0'
  24.  
  25. repositories {
  26.     maven { url "${artifactoryUrl}/libs-release" }
  27.     maven { url "${artifactoryUrl}/libs-alpha" }
  28.     maven { url "${artifactoryUrl}/libs-snapshot" }
  29. }
  30.  
  31. configurations {
  32.     deploy
  33. }
  34.  
  35. dependencies {
  36.     testCompile "junit:junit:3.8.1"
  37.     deploy "$project.group:$project.name:$project.deployment_version@war"
  38. }
  39.  
  40. task downloadBinary(type: Copy) {
  41.     from configurations.deploy
  42.     into "$buildDir/downloads"
  43. }
  44.  
  45. cargo {
  46.     containerId = 'tomcat7x'
  47.     port = 8080
  48.     deployable {
  49.         file = file("${buildDir}/downloads/${project.name}-${project.version}.war")
  50.         context = "${project.name}"
  51.     }
  52.     remote {
  53.         hostname = "tomcathostip"
  54.         username = "${deployment_username}"
  55.         password = "${deployment_password}"
  56.         timeout = 6000
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment