-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
130 lines (110 loc) · 4.21 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
// Repositories for plugins
buildscript {
repositories { mavenCentral() }
}
// Other plugins using plugins DSL
plugins {
id 'java'
id 'maven-publish' // // takes care of the metadata, generates the pom.xml when publishing to repo, deploys build output to repo
id 'signing' // signs generated artifacts: https://docs.gradle.org/current/userguide/signing_plugin.html
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
repositories {
mavenCentral()
}
def testSpringVersion = '6.1.2'
def servletApiVersion = '6.0.0'
dependencies {
// Required compile-time dependencies
implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
implementation 'org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1'
// Optional dependencies
compileOnly "jakarta.servlet:jakarta.servlet-api:$servletApiVersion"
// Test dependencies
testImplementation 'junit:junit:4.8.2'
testImplementation 'org.hibernate:hibernate-validator:8.0.1.Final'
testImplementation "org.springframework:spring-core:$testSpringVersion"
testImplementation "org.springframework:spring-web:$testSpringVersion"
testImplementation "org.springframework:spring-test:$testSpringVersion"
testImplementation 'jakarta.el:jakarta.el-api:6.0.0-M1'
testImplementation 'org.glassfish:jakarta.el:5.0.0-M1'
testImplementation "jakarta.servlet:jakarta.servlet-api:$servletApiVersion"
testImplementation 'commons-httpclient:commons-httpclient:3.1'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
// For publishing to Maven Central,
// see https://medium.com/viascom/publishing-to-maven-central-with-gradle-a-step-by-step-guide-f3f50724648f
// and https://central.sonatype.org/publish/publish-gradle/
// Deployment to Maven Central repository can be started using: ./gradlew clean publish --warn --stacktrace
// (with version that does not end with SNAPSHOT).
// The credentials for signing and upload are stored in <user-home>/.gradle/gradle.properties file
// Signing key is stored in <user-home>/AppData/Roaming/gnupg/secring.gpg
// Previous (obsolete) guide for publishing to public Maven central repo with Gradle:
// http://central.sonatype.org/pages/gradle.html
// http://jedicoder.blogspot.cz/2011/11/automated-gradle-project-deployment-to.html
publishing {
repositories {
maven {
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "OSSRH"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
groupId = 'net.formio'
// optionally artifactId can be defined here
artifactId = 'formio'
name = 'Formio'
description = 'Form definition and binding framework for Java platform'
url = 'http://www.formio.net'
packaging = 'jar' // jar is the default, but still set it to make it clear
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:[email protected]:beranradek/formio.git'
developerConnection = 'scm:git:[email protected]:beranradek/formio.git'
url = '[email protected]:beranradek/formio.git'
}
developers {
developer {
id = 'beranradek'
name = 'Radek Beran'
email = '[email protected]'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
// Turning off doclint javadoc style checker that produces strict errors.
// See: http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}