@@ -7,6 +7,7 @@ import javax.inject.Inject
77plugins {
88 id ' java'
99 id ' maven-publish'
10+ id ' org.jreleaser' version ' 1.26.0'
1011}
1112
1213interface InjectedExecOps {
@@ -15,7 +16,6 @@ interface InjectedExecOps {
1516}
1617
1718group = ' org-power-grid-model'
18- version = ' 1.0-SNAPSHOT'
1919
2020repositories {
2121 mavenCentral()
@@ -268,6 +268,21 @@ sourceSets {
268268 }
269269}
270270
271+ tasks. register(' sourcesJar' , Jar ) {
272+ dependsOn(tasks. named(' generatePGMBindings' ))
273+ from sourceSets. main. java
274+ archiveClassifier. set(' sources' )
275+ }
276+
277+ artifacts {
278+ archives sourcesJar
279+ }
280+
281+ java {
282+ withSourcesJar()
283+ withJavadocJar()
284+ }
285+
271286tasks. named(' compileJava' ) {
272287 dependsOn(tasks. named(' generatePGMBindings' ))
273288}
@@ -277,10 +292,64 @@ tasks.named('processResources') {
277292}
278293
279294publishing {
295+ repositories {
296+ maven {
297+ url = layout. buildDirectory. dir(" staging-deploy" )
298+ }
299+ }
280300 publications {
281301 mavenJava(MavenPublication ) {
282302 from components. java
283- artifactId = ' lib-power-grid-model'
303+ groupId = ' org.lfenergy.powergridmodel'
304+ artifactId = ' power-grid-model-ffm'
305+
306+ pom {
307+ name = ' power-grid-model-ffm'
308+ description = ' Java package which wraps PGM core shared library'
309+ url = ' https://github.com/PowerGridModel/libpower-grid-model-java'
310+ organization {
311+ name = ' LF Energy'
312+ url = ' https://lfenergy.org'
313+ }
314+ licenses {
315+ license {
316+ name = ' Mozilla Public License, Version 2.0'
317+ url = ' https://www.mozilla.org/en-US/MPL/2.0/'
318+ }
319+ }
320+ developers {
321+ developer {
322+ id = ' contributors'
323+ name = ' Power Grid Model Contributors'
324+ email = ' powergridmodel@lfenergy.org'
325+ url = ' https://github.com/PowerGridModel/libpower-grid-model-java'
326+ }
327+ }
328+ scm {
329+ url = ' https://github.com/PowerGridModel/libpower-grid-model-java'
330+ connection = ' scm:git:git://github.com/PowerGridModel/libpower-grid-model-java.git'
331+ developerConnection = ' scm:git:ssh://git@github.com/PowerGridModel/libpower-grid-model-java.git'
332+ }
333+ }
334+
335+ }
336+ }
337+ }
338+
339+ jreleaser {
340+ signing {
341+ active = ' ALWAYS'
342+ armored = true
343+ }
344+ deploy {
345+ maven {
346+ mavenCentral {
347+ ' release-deploy' {
348+ active = ' RELEASE'
349+ url = ' https://central.sonatype.com/api/v1/publisher'
350+ stagingRepository(' build/staging-deploy' )
351+ }
352+ }
284353 }
285354 }
286355}
0 commit comments