Skip to content

Instantly share code, notes, and snippets.

@Lobedan
Last active August 29, 2015 14:08
Show Gist options
  • Save Lobedan/fe42dfc6b342dae53a26 to your computer and use it in GitHub Desktop.
Save Lobedan/fe42dfc6b342dae53a26 to your computer and use it in GitHub Desktop.
Gradle Spring Boot Backend Configuration
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
configurations {
provided
}
jar {
baseName = 'sample'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "http://mosaic4cap.de/nexus/content/repositories/mosaic-releases/" }
maven { url "http://mosaic4cap.de/nexus/content/repositories/mosaic-snapshots/" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
compile "org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion"
compile "mysql:mysql-connector-java:$mysqlConnectorVersion"
compile "org.hibernate:hibernate-core:$hibernateVersion"
compile "org.apache.tomcat:tomcat-dbcp:$tomcatVersion"
compile "org.springframework.data:spring-data-jpa:$springDataVersion"
provided "org.springframework:core:$springVersion"
provided "org.springframework:beans:$springVersion"
provided "org.springframework:spring-context:$springVersion"
provided "org.springframework:spring-orm:$springVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.springframework:spring-test:$springVersion"
compile "com.h2database:h2:$h2Version"
}
task ('start', dependsOn: ['clean', 'bootRun'])
springBootVersion=1.1.8.RELEASE
springVersion=4.0.7.RELEASE
springDataVersion=1.7.1.RELEASE
junitVersion=4.11
h2Version=1.4.181
mysqlConnectorVersion=5.1.6
hibernateVersion=4.3.6.Final
tomcatVersion=7.0.52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment