-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
107 lines (95 loc) · 3.08 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
buildscript {
ext {
springBootVersion = '2.1.4'
springBootAdminVersion = '2.1.4'
springBootGradleVersion = '2.1.4.RELEASE'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/plugins-release' }
maven { url "https://repo.spring.io/libs-release" }
maven { url "https://repository.jboss.org/nexus/content/repositories/releases" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootGradleVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'application'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "http://repo.spring.io/libs-release" }
maven { url "https://plugins.gradle.org/m2/" }
}
applicationName="spring-boot-web-jpa"
mainClassName = "com.example.DemoApplication"
dependencies {
// starters https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-starter
compile "org.springframework.boot:spring-boot-starter-web"
compile('org.springframework.boot:spring-boot-starter-actuator')
compileOnly('org.projectlombok:lombok')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('com.h2database:h2')
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.15'
// https://mvnrepository.com/artifact/com.google.guava/guava
compile group: 'com.google.guava', name: 'guava', version: '27.1-jre'
testCompile('org.springframework.boot:spring-boot-starter-test')
compile('de.codecentric:spring-boot-admin-starter-server')
}
dependencyManagement {
imports {
mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
}
}
// for local publishing of jar to .m2 folder, to refer this jar by another local project
// make sure mavenLocal() is first in repositories list as shown above
// Ref: https://docs.gradle.org/current/userguide/publishing_maven.html
sourceSets{
main{
java.srcDir file('src/main/java')
resources.srcDir file('src/main/resources')
}
test{
java.srcDir file('src/test/java')
resources.srcDir file('src/test/resources')
}
}
// command to publish local artifect
// $ ./gradlew publishToMavenLocal
// commenting this to make github action happy
/*
apply plugin: 'maven-publish'
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
// Adding following version manually for local release
// Artifact will be generated at /Users/$USER/.m2/repository/<package>/*.jar
version = '0.0.1.x.snapshot'
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}*/