-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
161 lines (138 loc) · 4.27 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
159
160
161
// -*- coding: utf-8; mode: groovy -*-
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.18.0"
classpath "de.thetaphi:forbiddenapis:2.6"
classpath "de.aaschmid:gradle-cpd-plugin:2.0"
classpath "jp.classmethod.aws:gradle-aws-plugin:0.41"
}
}
plugins {
id 'java-library'
id 'org.springframework.boot' version '2.1.5.RELEASE'
id 'maven-publish'
}
// basic plugins
apply plugin: 'io.spring.dependency-management'
// code quality plugins
apply plugin: "checkstyle"
apply plugin: "findbugs"
apply plugin: "pmd"
apply plugin: "cpd"
apply plugin: "jacoco"
apply plugin: "de.thetaphi.forbiddenapis"
apply plugin: "com.diffplug.gradle.spotless"
// code quality configuration
apply from: "${rootProject.projectDir}/gradle/quality/checkstyle.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/findbugs.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/pmd.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/cpd.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/jacoco.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/forbiddenapis.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/spotless.gradle"
// custom configuration
apply from: "${rootProject.projectDir}/gradle/version.gradle"
apply from: "${rootProject.projectDir}/gradle/resolveDependencies.gradle"
apply from: "${rootProject.projectDir}/gradle/sourceArtifact.gradle"
group = "jp.xet.springframework.data.mirage"
ext.artifactId = "spring-data-mirage"
defaultTasks "clean", "build"
// compiler
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava {
options.compilerArgs << "-Werror"
options.compilerArgs << "-Xlint:all" << "-Xlint:-processing" << "-Xlint:-deprecation"
}
javadoc {
failOnError = false
}
repositories {
mavenCentral()
maven { url "http://maven.classmethod.info/snapshot" } // for spar-wings
maven { url "http://maven.classmethod.info/release" } // for spar-wings
}
configurations {
testCompile.extendsFrom compileOnly
}
dependencyManagement {
imports {
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
}
dependencies {
implementation "org.slf4j:slf4j-api"
implementation "com.google.guava:guava:$guavaVersion"
implementation "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
implementation "com.miragesql:miragesql:$mirageVersion"
implementation "com.miragesql:miragesql-integration:$mirageVersion"
compileOnly "org.springframework:spring-context"
compileOnly "org.springframework:spring-jdbc"
compileOnly "jp.xet.spar-wings:spar-wings-spring-data-chunk:$sparWingsVersion"
// tests
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.h2database:h2"
testImplementation "ch.qos.logback:logback-classic"
pmd 'net.sourceforge.pmd:pmd-java:6.16.0'
pmd 'org.ow2.asm:asm:7.1'
}
bootJar {
enabled = false
}
jar {
enabled = true
}
wrapper {
gradleVersion = '5.2.1'
distributionType = Wrapper.DistributionType.ALL
}
// ======== deploy ========
apply plugin: "jp.classmethod.aws"
aws {
profileName = null
}
publishing {
repositories {
maven {
def releasesRepoUrl = "${System.getenv("PUBLISH_REPOSITORY")}/release"
def snapshotsRepoUrl = "${System.getenv("PUBLISH_REPOSITORY")}/snapshot"
url version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials(AwsCredentials) {
def profileName = project.hasProperty("awsProfileForMetropolisRepo") ? project.awsProfileForMetropolisRepo : null
def cred = aws.newCredentialsProvider(profileName).credentials
accessKey cred.getAWSAccessKeyId()
secretKey cred.getAWSSecretKey()
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.name
description project.description
inceptionYear "2015"
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/license/LICENSE-2.0.txt"
distribution "repo"
}
}
}
}
}
}
}