-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathbuild.gradle
148 lines (130 loc) · 4.61 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
plugins {
id 'java'
id 'idea'
id 'maven'
id 'signing'
id 'com.dorongold.task-tree' version '1.3'
}
def isLocalDeployment = project.hasProperty("local")
compileJava {
sourceCompatibility = '1.8'
}
repositories {
mavenCentral()
}
configurations {
all*.exclude module : 'spring-boot-starter-logging'
providedCompile
}
sourceSets.main.compileClasspath += configurations.providedCompile
sourceSets.test.compileClasspath += configurations.providedCompile
sourceSets.test.runtimeClasspath += configurations.providedCompile
dependencies {
compile 'com.google.guava:guava:26.0-jre'
compile 'org.apache.commons:commons-lang3:3.8.1'
compile 'org.freemarker:freemarker:2.3.28'
compile 'org.yaml:snakeyaml:1.23'
compile 'org.slf4j:slf4j-api:1.7.25'
compileOnly 'org.projectlombok:lombok:1.18.2'
compileOnly 'jakarta.annotation:jakarta.annotation-api:2.1.1'
providedCompile gradleApi()
providedCompile 'org.apache.maven:maven-plugin-api:3.5.4'
testCompile 'junit:junit:4.12'
testCompile 'com.h2database:h2:1.4.197'
// Can be removed after no javax support
testCompile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final'
testCompile 'jakarta.persistence:jakarta.persistence-api:3.0.0'
testCompileOnly 'org.projectlombok:lombok:1.18.2'
// Can be removed after no javax support
testCompileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testCompileOnly 'jakarta.annotation:jakarta.annotation-api:2.1.1'
}
sourceSets {
main {
java {
exclude 'com/smartnews/jpa_entity_generator/maven/**'
}
}
}
test {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
testLogging.showStandardStreams = true
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
// http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
if (!isLocalDeployment) {
signing {
sign configurations.archives
}
}
// Refer to this page https://central.sonatype.org/publish/publish-gradle/
try {
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = 'com.smartnews'
pom.artifactId = 'jpa-entity-generator'
pom.version = '0.99.9' // Please update this version manually
if (isLocalDeployment) {
def localRepoPath = 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
repository(url: localRepoPath)
snapshotRepository(url: localRepoPath)
} else {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: "$System.env.SONATYPE_NEXUS_USER", password: "$System.env.SONATYPE_NEXUS_PASS")
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: "$System.env.SONATYPE_NEXUS_USER", password: "$System.env.SONATYPE_NEXUS_PASS")
}
}
pom.project {
name 'JPA Entity Generator'
description 'Lombok-wired JPA entity source code generator, Gradle and Maven supported.'
packaging 'jar'
url 'https://github.com/smartnews/jpa-entity-generator'
scm {
connection '[email protected]:smartnews/jpa-entity-generator.git'
developerConnection '[email protected]:smartnews/jpa-entity-generator.git'
url 'https://github.com/smartnews/jpa-entity-generator'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'seratch'
name 'Kazuhiro Sera'
email '[email protected]'
}
}
}
}
}
}
} catch (MissingPropertyException e) { e.printStackTrace() }