@@ -21,6 +21,7 @@ plugins {
2121 id ' com.github.jk1.dependency-license-report' version ' 2.1'
2222 id ' io.spring.dependency-management' version ' 1.1.0'
2323 id ' net.ltgt.errorprone' version ' 3.0.1' apply false
24+ id ' org.jreleaser' version ' 1.16.0'
2425 id ' java'
2526 id ' application'
2627}
@@ -45,20 +46,22 @@ application {
4546}
4647
4748allprojects {
49+ group = project. group
50+ version = project. version
4851 apply plugin : ' java-library'
49- apply plugin : ' java-test-fixtures'
5052 apply plugin : ' io.spring.dependency-management'
5153 apply plugin : ' net.ltgt.errorprone'
5254 apply from : " ${ rootDir} /gradle/versions.gradle"
53-
5455 version = rootProject. version
5556
57+ java {
58+ withSourcesJar()
59+ withJavadocJar()
60+ }
5661
57- task sourcesJar(type : Jar , dependsOn : classes) {
58- archiveClassifier = ' sources'
59- from sourceSets. main. allSource
60- jar. reproducibleFileOrder = true
61- jar. preserveFileTimestamps = false
62+ test {
63+ // set a runtime shomei version for tests not executing from a jar
64+ systemProperty " shomei.version" , project. version
6265 }
6366
6467 sourceCompatibility = ' 21'
@@ -69,7 +72,7 @@ allprojects {
6972 mavenCentral()
7073 maven {
7174 url " https://artifacts.consensys.net/public/maven/maven/"
72- content { includeGroupByRegex(' tech\\ .pegasys($|\\ ..*)' )}
75+ content { includeGroupByRegex(' tech\\ .pegasys($|\\ ..*)' ) }
7376 }
7477 maven {
7578 url " https://dl.cloudsmith.io/public/libp2p/jvm-libp2p/maven/"
@@ -92,7 +95,7 @@ allprojects {
9295 // restict this so we do not accidentally pull in other artifacts from github
9396 exclusiveContent {
9497 forRepositories(besuShomeiPluginRelease)
95- filter { includeModule(' ConsenSys' , ' besu-shomei-plugin' )}
98+ filter { includeModule(' ConsenSys' , ' besu-shomei-plugin' ) }
9699 }
97100
98101 }
@@ -187,6 +190,115 @@ allprojects {
187190 }
188191}
189192
193+ // config the deferred groupId
194+ def groupVal = project. findProperty(" groupVal" ) ?: ' io.consensys.protocols.shomei'
195+
196+ subprojects {
197+
198+ apply plugin : ' maven-publish'
199+ publishing {
200+ publications {
201+ mavenJava(MavenPublication ) {
202+ versionMapping {
203+ allVariants {
204+ fromResolutionResult()
205+ }
206+ }
207+
208+ from components. java
209+ artifactId = project. name == ' shomei' ? ' shomei' : " shomei-${ project.name} "
210+ groupId = groupVal
211+ version = project. version. toString()
212+ suppressPomMetadataWarningsFor(" testFixturesApiElements" )
213+ suppressPomMetadataWarningsFor(" testFixturesRuntimeElements" )
214+
215+ pom {
216+ name. set(" Shomei module: ${ project.path} " )
217+ description. set(" Module ${ project.name} of shomei" )
218+ url. set(" https://github.com/consensys/shomei" )
219+ licenses {
220+ license {
221+ name. set(" Apache-2.0" )
222+ url. set(" https://www.apache.org/licenses/LICENSE-2.0" )
223+ }
224+ }
225+ scm {
226+ connection. set(" scm:git:https://github.com/consensys/shomei.git" )
227+ developerConnection. set(" scm:git:ssh://git@github.com:consensys/shomei.git" )
228+ url. set(" https://github.com/consensys/shomei" )
229+ }
230+ developers {
231+ developer {
232+ id. set(" consensys" )
233+ name. set(" Protocols Team" )
234+ email. set(" devops@consensys.net" )
235+ }
236+ }
237+ }
238+ }
239+ }
240+
241+ repositories {
242+ // publish to a staging directory for jreleaser to release from:
243+ // ./gradlew publish
244+ maven {
245+ url = rootProject. layout. buildDirectory. dir(" staging-deploy" )
246+ }
247+ }
248+ }
249+ }
250+
251+ jreleaser {
252+ project {
253+ description = ' Shomei - a zero-knowledge proof orchestrator'
254+ copyright = ' Copyright 2025 ConsenSys'
255+ java {
256+ groupId = groupVal
257+ }
258+ }
259+ release {
260+ github {
261+ // Creating and tagging a release is done manually
262+ skipRelease = true
263+ skipTag = true
264+ // injecting a fake value to make JReleaser happy
265+ token = " foobar"
266+ }
267+ }
268+ signing {
269+ active = ' ALWAYS'
270+ armored = true
271+ verify = true
272+ }
273+ deploy {
274+ maven {
275+ mavenCentral {
276+ sonatype {
277+ active = ' ALWAYS'
278+ url = ' https://central.sonatype.com/api/v1/publisher'
279+ stagingRepository(' build/staging-deploy' )
280+ retryDelay = 60
281+ maxRetries = 100
282+ }
283+ }
284+ }
285+ }
286+ }
287+
288+ // Create a task to prepare the jreleaser directory.
289+ task prepareJreleaserDirectory {
290+ doLast {
291+ file(rootProject. layout. buildDirectory. dir(" jreleaser" )). mkdirs()
292+ }
293+ }
294+
295+ // Make every task whose name starts with "jreleaser" depend on the preparation task.
296+ tasks. all { t ->
297+ if (t. name. startsWith(" jreleaser" )) {
298+ t. dependsOn prepareJreleaserDirectory
299+ }
300+ }
301+
190302jar { enabled = false }
191303
192304dependencies {
0 commit comments