22//
33// SPDX-License-Identifier: MPL-2.0
44
5+
6+ import org.jreleaser.model.Active
7+
58import javax.inject.Inject
69
710plugins {
811 id ' java'
912 id ' maven-publish'
13+ id ' org.jreleaser' version ' 1.26.0'
1014}
1115
1216interface InjectedExecOps {
@@ -268,6 +272,20 @@ sourceSets {
268272 }
269273}
270274
275+ tasks. register(' sourcesJar' , Jar ) {
276+ dependsOn(tasks. named(' generatePGMBindings' ))
277+ from sourceSets. main. java
278+ archiveClassifier. set(' sources' )
279+ }
280+
281+ artifacts {
282+ archives sourcesJar
283+ }
284+
285+ java {
286+ withJavadocJar()
287+ }
288+
271289tasks. named(' compileJava' ) {
272290 dependsOn(tasks. named(' generatePGMBindings' ))
273291}
@@ -280,7 +298,60 @@ publishing {
280298 publications {
281299 mavenJava(MavenPublication ) {
282300 from components. java
301+ groupId = ' org.lfenergy.pgm'
283302 artifactId = ' lib-power-grid-model'
303+
304+ pom {
305+ name = ' lib-power-grid-model'
306+ description = ' '
307+ url = ' https://github.com/PowerGridModel/libpower-grid-model-java'
308+ organization {
309+ name = ' LF Energy'
310+ url = ' https://lfenergy.org'
311+ }
312+ licenses {
313+ license {
314+ name = ' Mozilla Public License, Version 2.0"'
315+ url = ' https://www.mozilla.org/en-US/MPL/2.0/'
316+ }
317+ }
318+ developers {
319+ developer {
320+ email = ' powergridmodel@lfenergy.org'
321+ }
322+ }
323+ scm {
324+ url = ' https://github.com/PowerGridModel/libpower-grid-model-java'
325+ connection = ' scm:git:git://github.com/PowerGridModel/libpower-grid-model-java.git'
326+ developerConnection = ' scm:git:ssh://git@github.com/PowerGridModel/libpower-grid-model-java.git'
327+ }
328+ }
329+
330+ }
331+ }
332+ }
333+
334+ jreleaser {
335+ signing {
336+ active = ' ALWAYS'
337+ armored = true
338+ }
339+ deploy {
340+ maven {
341+ // mavenCentral {
342+ // 'release-deploy' {
343+ // active = 'RELEASE'
344+ // url = 'https://central.sonatype.com/api/v1/publisher'
345+ // }
346+ // }
347+ nexus2 {
348+ ' snapshot-deploy' {
349+ active = ' SNAPSHOT'
350+ snapshotUrl = ' https://central.sonatype.com/repository/maven-snapshots/'
351+ applyMavenCentralRules = true
352+ snapshotSupported = true
353+ }
354+ }
284355 }
285356 }
286357}
0 commit comments