-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
158 lines (132 loc) · 4.3 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/**
* @author Nikita Kolytschew
* @version %I%, %G%
* @since 1.0.0-SNAPSHOT
*/
// default spring-boot build-script
buildscript {
ext {
springBootVersion = '1.4.3.RELEASE'
gradleDockerVersion = '1.2'
// coberturaVersion = '2.3.2'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "se.transmode.gradle:gradle-docker:${gradleDockerVersion}"
// classpath "net.saliman:gradle-cobertura-plugin:${coberturaVersion}"
}
}
/**
*
* this was how the plugin is intended to be used
* using new Gradle plugins DSL see: https://github.com/aaschmid/gradle-cpd-plugin
**/
plugins {
id "de.aaschmid.cpd" version "1.0"
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
// IDE Plugins
apply plugin: 'eclipse'
apply plugin: 'idea'
/**
* make sure, all sub project have at least the basic tasks*/
subprojects {
apply plugin: 'base'
}
// Docker
apply plugin: 'docker'
// custom properties
apply from: "$projectDir/gradle/properties/custom_properties.gradle"
// set spring profile
// use native type to avoid boxing
ext.activeProfile = System.properties['spring.profiles.active'] ?: "dev,h2,copy"
// plugins
apply from: "$projectDir/gradle/plugins/checkstyle_plugin.gradle"
apply from: "$projectDir/gradle/plugins/pmd_plugin.gradle"
apply from: "$projectDir/gradle/plugins/findbugs_plugin.gradle"
apply from: "$projectDir/gradle/plugins/cpd_plugin.gradle"
apply from: "$projectDir/gradle/plugins/jacoco_plugin.gradle"
// apply from: "$projectDir/gradle/plugins/cobertura_plugin.gradle"
// default project definition
// docker image prefix will be taken from group
group = "inspectit.rocks"
version = "1.1.1-SNAPSHOT"
description = "Open Source Marketplace"
project.ext.finalName = jar.baseName
// Java Version
sourceCompatibility = 1.8
targetCompatibility = 1.8
// add jar information
jar {
baseName = 'marketplace'
}
// tasks
apply from: "$projectDir/gradle/tasks/spring_boot_task.gradle"
apply from: "$projectDir/gradle/tasks/docker_tasks.gradle"
task testJavadoc(type: Javadoc) {
source = sourceSets.test.allJava
classpath = sourceSets.test.compileClasspath
destinationDir = file("${buildQAMainExportDir}/javadoc")
println(title == null ? '<null>' : title)
}
// define repo to obtain dependencies from
repositories {
mavenCentral()
// jcenter()
}
// set dependencies
ext {
securityOauthVersion = '2.0.11.RELEASE'
dozerVersion = '5.5.1'
dbunitVersion = '2.5.3'
flywayVersion = '4.0.3'
jsonPathVersion = '2.2.0'
testDBUnitVersion = '1.3.0'
swaggerVersion = '1.5.12'
springfoxVersion = '2.6.1'
}
dependencies {
// spring boot starter
compile "org.springframework.boot:spring-boot-starter-actuator"
// default web starter contains web-mvc and tomcat
compile "org.springframework.boot:spring-boot-starter-web"
// starter with default spring security config
compile "org.springframework.boot:spring-boot-starter-security"
// starter for database operation, contains hibernate, persistence and jpa
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
// security and OAuth
compile "org.springframework.security.oauth:spring-security-oauth2:${securityOauthVersion}"
// mapping
compile "net.sf.dozer:dozer:${dozerVersion}"
// Database
compile "org.dbunit:dbunit:${dbunitVersion}"
compile 'com.h2database:h2'
// use flyway for high-level database migration
compile "org.flywaydb:flyway-core:${flywayVersion}"
// use swagger for API documentation
compile "io.swagger:swagger-core:${swaggerVersion}"
compile "io.springfox:springfox-swagger2:${springfoxVersion}"
compile "io.springfox:springfox-swagger-ui:${springfoxVersion}"
// unit test spring
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
// unit test REST
testCompile "com.jayway.jsonpath:json-path:${jsonPathVersion}"
// unit test database
testCompile "com.github.springtestdbunit:spring-test-dbunit:${testDBUnitVersion}"
}
// define wrapper version to 3.1
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '3.1'
}
// replace placeholder in application.properties only, since application-dev.properties container hard coded values
processResources {
filesMatching('**/application.properties') {
expand(project.properties)
}
}