generated from openMF/ph-ee-start-here
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle
215 lines (201 loc) · 7.44 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'eclipse'
id 'maven-publish'
id 'checkstyle'
id "com.jfrog.artifactory" version "4.24.23"
id 'org.springframework.boot' version '2.6.2'
id 'com.diffplug.spotless' version '6.19.0'
}
apply plugin: "io.spring.dependency-management"
repositories {
// mavenLocal()
maven {
url = uri('https://repo.maven.apache.org/maven2')
}
}
apply plugin:'com.diffplug.spotless'
spotless {
format 'misc', {
target '**/*.md', '**/*.properties', '**/.gitignore', '**/.openapi-generator-ignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**', '**/gradlew.bat', '**/licenses/**', '**/banner.txt', '.vscode/**'
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}
groovyGradle {
target '*.gradle', '**/*.gradle'
targetExclude '**/build/**'
greclipse()
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}
lineEndings 'UNIX'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework:spring-webmvc'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'com.auth0:java-jwt:3.10.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.1'
implementation 'org.json:json:20190722'
implementation 'io.camunda:zeebe-client-java:8.1.1'
implementation 'org.apache.camel:camel-core:3.4.0'
implementation 'commons-codec:commons-codec:1.15'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.commons:commons-lang3:3.14.0'
testImplementation 'org.springframework:spring-web:5.2.2.RELEASE'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.2.RELEASE'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
compileOnly 'org.hibernate.validator:hibernate-validator:6.0.20.Final'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
checkstyle 'com.puppycrawl.tools:checkstyle:10.9.3'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.44.1'
implementation 'com.diffplug.gradle.spotless:spotless:2.4.1'
implementation 'com.diffplug.spotless:spotless-plugin-gradle:6.17.0'
implementation 'org.springframework.boot:spring-boot-starter-webflux:2.4.1'
}
configure(this) {
// NOTE: order matters!
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
configurations {
implementation.setCanBeResolved(true)
api.setCanBeResolved(true)
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
"-Xlint:unchecked",
"-Xlint:cast",
"-Xlint:auxiliaryclass",
"-Xlint:deprecation",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:exports",
"-Xlint:fallthrough",
"-Xlint:finally",
"-Xlint:module",
"-Xlint:opens",
"-Xlint:options",
"-Xlint:overloads",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:removal",
"-Xlint:requires-automatic",
"-Xlint:requires-transitive-automatic",
"-Xlint:try",
"-Xlint:varargs",
"-Xlint:preview",
"-Xlint:static",
// -Werror needs to be disabled because EclipseLink's static weaving doesn't generate warning-free code
// and during an IntelliJ recompilation, it fails
//"-Werror",
"-Xmaxwarns",
1500,
"-Xmaxerrs",
1500
]
options.deprecation = true
}
// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
java {
targetExclude '**/build/**', '**/bin/**', '**/out/**'
importOrder() //sort imports alphabetically
removeUnusedImports()
eclipse().configFile "$rootDir/config/common-formatter.xml"
endWithNewline()
trimTrailingWhitespace()
// Enforce style modifier order
custom 'Modifier ordering', {
def modifierRanking = [
public : 1,
protected : 2,
private : 3,
abstract : 4,
default : 5,
static : 6,
final : 7,
transient : 8,
volatile : 9,
synchronized: 10,
native : 11,
strictfp : 12]
// Find any instance of multiple modifiers. Lead with a non-word character to avoid
// accidental matching against for instance, "an alternative default value"
it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
// Do not replace the leading non-word character. Identify the modifiers
it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
// Sort the modifiers according to the ranking above
it.split().sort({ modifierRanking[it] }).join(' ') + ' '
}
)
}
)
}
}
lineEndings 'UNIX'
}
// If we are running Gradle within Eclipse to enhance classes,
// set the classes directory to point to Eclipse's default build directory
if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') {
sourceSets.main.java.outputDir = file("$projectDir/bin/main")
}
// Configuration for the Checkstyle plugin
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:10.3.1'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.42.0'
}
dependencies {
implementation("io.netty:netty-all:4.1.68.Final")
}
}
group = 'org.mifos'
version = '0.0.0'
sourceCompatibility = JavaVersion.VERSION_17
def artifactId = 'ph-ee-connector-common'
def versionNumber = version
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jar {
enabled = true
}
artifactory {
contextUrl = 'https://jfrog.sandbox.fynarfin.io/artifactory' // base artifactory url
publish {
repository {
repoKey = 'fyn-libs-snapshot' //Artifactory repository key to publish to
// username = 'avik@fynarfin.io' publisher user name
// password = '****' publisher password
username = gradle.app_username
password = gradle.app_password
maven = true
}
defaults {
publications('mavenJava')
}
}
}
artifactoryPublish {
dependsOn jar
}