1
1
val jenaVersion = " 4.10.0"
2
+ val guavaVersion = " 33.3.0-jre"
2
3
val springVersion = " 5.3.+"
3
4
val jakartaAnnotationApiVersion = " 3.0.0"
4
- val guavaVersion = " 33.3.0-jre"
5
- val jupiterVersion = " 5.11.0"
6
5
val jb4jsonldJacksonVersion = " 0.14.3"
7
6
val logbackVersion = " 1.5.7"
7
+ val jupiterVersion = " 5.11.0"
8
8
9
9
plugins {
10
10
`java- library`
11
11
pmd
12
12
jacoco
13
13
id(" io.freefair.lombok" ) version " 8.10"
14
14
id(" org.owasp.dependencycheck" ) version " 10.0.3"
15
+ id(" maven-publish" )
16
+ id(" signing" )
17
+ id(" pl.allegro.tech.build.axion-release" ) version " 1.13.3"
15
18
}
16
19
17
20
group = " zone.cogni.semanticz"
18
- version = " 1.0.0 "
21
+
19
22
20
23
repositories {
21
24
mavenCentral()
@@ -25,8 +28,28 @@ java {
25
28
toolchain {
26
29
languageVersion.set(JavaLanguageVersion .of(11 ))
27
30
}
31
+ withJavadocJar()
32
+ withSourcesJar()
33
+ }
34
+
35
+ version = scmVersion.version
36
+ scmVersion {
37
+ tag.apply {
38
+ prefix = " v"
39
+ versionSeparator = " "
40
+ branchPrefix = mapOf (
41
+ " release/.*" to " release-v" ,
42
+ " hotfix/.*" to " hotfix-v"
43
+ )
44
+ }
45
+ nextVersion.apply {
46
+ suffix = " SNAPSHOT"
47
+ separator = " -"
48
+ }
49
+ versionIncrementer(" incrementPatch" ) // Increment the patch version
28
50
}
29
51
52
+
30
53
pmd {
31
54
isIgnoreFailures = true
32
55
isConsoleOutput = true
@@ -67,4 +90,82 @@ tasks.test {
67
90
68
91
tasks.jacocoTestReport {
69
92
dependsOn(tasks.test)
70
- }
93
+ }
94
+
95
+ tasks.jar {
96
+ from(" ${projectDir} " ) {
97
+ include(" LICENSE" )
98
+ into(" META-INF" )
99
+ }
100
+ }
101
+
102
+ publishing {
103
+ publications {
104
+ create<MavenPublication >(" mavenJava" ) {
105
+ from(components[" java" ])
106
+
107
+ pom {
108
+ name.set(" semanticz-irigenerator" )
109
+ description.set(" This project serves for generating IRIs using a predefined template based on existing RDF data." )
110
+ url.set(" https://github.com/cognizone/semanticz-irigenerator" )
111
+
112
+ scm {
113
+ connection.set(
" scm:[email protected] :cognizone/semanticz-irigenerator.git" )
114
+ developerConnection.set(
" scm:[email protected] :cognizone/semanticz-irigenerator.git" )
115
+ url.set(" https://github.com/cognizone/semanticz-irigenerator" )
116
+ }
117
+
118
+ licenses {
119
+ license {
120
+ name.set(" The Apache License, Version 2.0" )
121
+ url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
122
+ }
123
+ }
124
+
125
+ developers {
126
+ developer {
127
+ id.set(" cognizone" )
128
+ name.set(" Cognizone" )
129
+
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ repositories {
137
+ if (project.hasProperty(" publishToMavenCentral" )) {
138
+ maven {
139
+ credentials {
140
+ username = System .getProperty(" ossrh.username" )
141
+ password = System .getProperty(" ossrh.password" )
142
+ }
143
+ val stagingRepoUrl = " ${System .getProperty(" ossrh.url" )} /service/local/staging/deploy/maven2"
144
+ val snapshotsRepoUrl = " ${System .getProperty(" ossrh.url" )} /content/repositories/snapshots"
145
+ url = uri(if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else stagingRepoUrl)
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ tasks.withType<Javadoc > {
152
+ options {
153
+ (this as StandardJavadocDocletOptions ).addBooleanOption(" Xdoclint:none" , true )
154
+ }
155
+ isFailOnError = false
156
+ }
157
+
158
+ signing {
159
+ useInMemoryPgpKeys(
160
+ project.findProperty(" signing.keyId" )?.toString(),
161
+ project.findProperty(" signing.password" )?.toString(),
162
+ project.findProperty(" signing.secretKeyRingFile" )?.toString()
163
+ )
164
+ if (project.hasProperty(" publishToMavenCentral" )) {
165
+ sign(publishing.publications[" mavenJava" ])
166
+ }
167
+ }
168
+
169
+ tasks.withType<PublishToMavenRepository > {
170
+ dependsOn(tasks.withType<Sign >())
171
+ }
0 commit comments