Created
November 30, 2017 07:06
-
-
Save rozaydin/cab65a0a724dc9ddd1f0f6b74154deb7 to your computer and use it in GitHub Desktop.
Gradle Template For Java Projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group 'com.rhtech' | |
version '1.0-SNAPSHOT' | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath( | |
'org.springframework.boot:spring-boot-gradle-plugin:1.5.8.RELEASE' | |
) | |
} | |
} | |
apply plugin: 'java' | |
apply plugin: 'idea' | |
apply plugin: 'org.springframework.boot' | |
sourceCompatibility = 9 | |
targetCompatibility = 9 | |
repositories { | |
mavenCentral() | |
} | |
sourceSets { | |
intTest { | |
java { | |
compileClasspath += main.output + test.output | |
runtimeClasspath += main.output + test.output | |
srcDir file('src/intTest/java') | |
} | |
resources.srcDirs = ['src/intTest/resources', 'src/main/resources'] | |
} | |
} | |
jar { | |
manifest { | |
attributes 'Main-Class': 'com.rhtech.servisim.Application' | |
} | |
} | |
configurations { | |
intTestCompile.extendsFrom testCompile | |
intTestRuntime.extendsFrom testRuntime | |
} | |
task intTest(type: Test) { | |
testClassesDir = sourceSets.intTest.output.classesDir | |
classpath = sourceSets.intTest.runtimeClasspath | |
outputs.upToDateWhen { false } | |
} | |
check.dependsOn intTest | |
intTest.mustRunAfter test | |
dependencies { | |
compileOnly "org.projectlombok:lombok:1.16.16" | |
testCompile("org.springframework.boot:spring-boot-starter-test") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment