-
Notifications
You must be signed in to change notification settings - Fork 91
/
build.gradle
134 lines (117 loc) · 3.75 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
plugins {
id "java"
id "java-library"
id "maven-publish"
id "signing"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
// run gradle with "-Dsnapshot=true" to automatically append "-SNAPSHOT" to the version
version = '2.0.0' + (Boolean.valueOf(System.getProperty("snapshot")) ? "-SNAPSHOT" : "")
sourceCompatibility = 17
ext{
buildNumber = System.getProperty("build.number")
docx4JVersion = System.getProperty("docx4j.version") ? System.getProperty("docx4j.version") : '11.4.9'
}
dependencies {
implementation("commons-io:commons-io:2.11.0")
implementation("org.javassist:javassist:3.29.2-GA")
implementation("org.springframework:spring-expression:6.0.11")
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.0")
// We want docx-stamper to be usable with any docx4j version, so the dependency to docx4J
// has to be provided by the client.
compileOnly("org.docx4j:docx4j-JAXB-ReferenceImpl:${docx4JVersion}")
testImplementation("org.docx4j:docx4j-JAXB-ReferenceImpl:${docx4JVersion}")
testImplementation("junit:junit:4.4")
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
licenses {
license {
name "MIT"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
developers {
developer {
id "thombergs"
name "Tom Hombergs"
email "[email protected]"
}
}
scm {
url "https://github.com/thombergs/docx-stamper"
}
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
groupId = 'io.reflectoring'
artifactId = 'docx-stamper'
version = project.version
pom {
name = 'DocxStampler'
description = 'Template engine for .docx documents.'
url = 'https://github.com/thombergs/docx-stamper'
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id = 'thombergs'
name = 'Tom Hombergs'
email = '[email protected]'
}
}
scm {
connection = 'https://github.com/thombergs/docx-stamper'
developerConnection = 'https://github.com/thombergs/docx-stamper'
url = 'https://github.com/thombergs/docx-stamper'
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
def signingKey = new String(Base64.getDecoder().decode(System.getenv("SIGNING_KEY_BASE64")))
def signingPassword = System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign configurations.archives
sign publishing.publications.mavenPublication
}
// we don't want to sign the artifacts unless we publish
signArchives.onlyIf{gradle.startParameter.getTaskNames().contains("publish")}