buildscript {
	ext {
		springBootVersion = '2.0.0.BUILD-SNAPSHOT'
	}
	repositories {
		mavenCentral()
		maven { url "https://repo.spring.io/snapshot" }
		maven { url "https://repo.spring.io/milestone" }
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
		classpath('se.transmode.gradle:gradle-docker:1.2')
	}
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'docker'

//version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

// This is used as the docker image prefix (org)
group = 'sivaprasadreddy'

jar {
	baseName = 'springboot-heroku-demo'
	version = '1.0-SNAPSHOT'
	archiveName = 'springboot-heroku-demo.jar'
}

task buildDocker(type: Docker, dependsOn: build) {
	push = false
	applicationName = jar.baseName
	dockerfile = file('src/main/docker/Dockerfile')
	doFirst {
		copy {
			from jar
			into stageDir
		}
	}
}

repositories {
	mavenCentral()
	maven { url "https://repo.spring.io/snapshot" }
	maven { url "https://repo.spring.io/milestone" }
}

dependencies {

	compile('org.springframework.boot:spring-boot-starter-data-jpa')
	compile('org.springframework.boot:spring-boot-starter-web')
	compile('org.springframework.boot:spring-boot-starter-thymeleaf')
	runtime('com.h2database:h2')
	runtime('org.postgresql:postgresql')
	//runtime('mysql:mysql-connector-java')
	testCompile('org.springframework.boot:spring-boot-starter-test')
}
