@@ -172,69 +172,49 @@ uploadArchives {
172172}
173173*/
174174
175- // ------------------------------------
176- // PUBLISHING TO SONATYPE CONFIGURATION
177- // ------------------------------------
178- object PublishMetaData {
179- val COMPONENT_TYPE = " java" // "java" or "versionCatalog"
180- val GROUP = project.group.toString()
181- val ARTIFACT_ID = project.name
182- val VERSION = project.version.toString()
183- val URL = " https://github.com/Phactum/lightweight-process-monitoring-common.git"
184- val PUBLISHING_TYPE = " USER_MANAGED" // USER_MANAGED or AUTOMATIC
185- val SHA_ALGORITHMS = listOf (" SHA-256" , " SHA-512" ) // sha256 and sha512 are supported but not mandatory. Only sha1 is mandatory but it is supported by default.
186- val DESC = " Test deployment only"
187- val LICENSE = " MIT"
188- val LICENSE_URL = " https://opensource.org/licenses/MIT"
189- val GITHUB_REPO = " Phactum/lightweight-process-monitoring-common.git"
190- val DEVELOPER_ID = " phactum-developer"
191- val DEVELOPER_NAME = " Phactum Developer"
192- val DEVELOPER_ORGANIZATION = " Phactum Softwareentwicklung GmbH"
193- val DEVELOPER_ORGANIZATION_URL = " https://www.phactum.at/"
194- }
195-
196- val sonatypeUsername: String? by project // this is defined in ~/.gradle/gradle.properties
197- val sonatypePassword: String? by project // this is defined in ~/.gradle/gradle.properties
198-
175+ // ----------------------
176+ // PUBLISHING TO SONATYPE
177+ // ----------------------
178+ // eu.kakde.gradle.sonatype-maven-central-publisher
199179sonatypeCentralPublishExtension {
200180 // Set group ID, artifact ID, version, and other publication details
201- groupId.set(PublishMetaData . GROUP )
202- artifactId.set(PublishMetaData . ARTIFACT_ID )
203- version.set(PublishMetaData . VERSION )
204- componentType.set(PublishMetaData . COMPONENT_TYPE ) // "java" or "versionCatalog"
205- publishingType.set(PublishMetaData . PUBLISHING_TYPE ) // USER_MANAGED or AUTOMATIC
181+ groupId.set(project.group.toString() )
182+ artifactId.set(project.name )
183+ version.set(project.version.toString() )
184+ componentType.set(" java " ) // "java" or "versionCatalog"
185+ publishingType.set(" USER_MANAGED " ) // USER_MANAGED or AUTOMATIC
206186
207187 // Set username and password for Sonatype repository
208- username.set(System .getenv(" SONATYPE_USERNAME" ) ? : sonatypeUsername)
209- password.set(System .getenv(" SONATYPE_PASSWORD" ) ? : sonatypePassword)
188+ username.set(System .getenv(" SONATYPE_USERNAME" ) ? : project.properties[ " sonatypeUsername" ].toString() )
189+ password.set(System .getenv(" SONATYPE_PASSWORD" ) ? : project.properties[ " sonatypePassword" ].toString() )
210190
211191 // Configure POM metadata
212192 pom {
213- name.set(PublishMetaData . ARTIFACT_ID )
214- description.set(PublishMetaData . DESC )
215- url.set(PublishMetaData . URL )
193+ name.set(project.name )
194+ description.set(" Support artifact for the lightweight library for process monitoring. " )
195+ url.set(" https://github.com/Phactum/lightweight-process-monitoring-common.git " )
216196 licenses {
217197 license {
218- name.set(PublishMetaData . LICENSE )
219- url.set(PublishMetaData . LICENSE_URL )
198+ name.set(" MIT " )
199+ url.set(" https://opensource.org/licenses/MIT " )
220200 }
221201 }
222202 developers {
223203 developer {
224- id.set(PublishMetaData . DEVELOPER_ID )
225- name.set(PublishMetaData . DEVELOPER_NAME )
226- organization.set(PublishMetaData . DEVELOPER_ORGANIZATION )
227- organizationUrl.set(PublishMetaData . DEVELOPER_ORGANIZATION_URL )
204+ id.set(" phactum-developer " )
205+ name.set(" Phactum Developer " )
206+ organization.set(" Phactum Softwareentwicklung GmbH " )
207+ organizationUrl.set(" https://www.phactum.at/ " )
228208 }
229209 }
230210 scm {
231- url.set(" https://github.com/${ PublishMetaData . GITHUB_REPO } " )
232- connection.set(" scm:git:https://github.com/${ PublishMetaData . GITHUB_REPO } " )
233- developerConnection.set(" scm:git:https://github.com/${ PublishMetaData . GITHUB_REPO } " )
211+ url.set(" https://github.com/Phactum/lightweight-process-monitoring-common.git " )
212+ connection.set(" scm:git:https://github.com/Phactum/lightweight-process-monitoring-common.git " )
213+ developerConnection.set(" scm:git:https://github.com/Phactum/lightweight-process-monitoring-common.git " )
234214 }
235215 issueManagement {
236216 system.set(" GitHub" )
237- url.set(" https://github.com/${ PublishMetaData . GITHUB_REPO } /issues" )
217+ url.set(" https://github.com/Phactum/lightweight-process-monitoring-common.git /issues" )
238218 }
239219 }
240220}
0 commit comments