File tree Expand file tree Collapse file tree
devops-boot-tools/devops-boot-gradle-plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import de.marcphilipp.gradle.nexus.NexusPublishExtension
2+
13description = " Tencent BlueKing DevOps Framework Build"
24
35plugins {
46 kotlin(" jvm" ) version Versions .Kotlin apply false
57 kotlin(" kapt" ) version Versions .Kotlin apply false
68 kotlin(" plugin.spring" ) version Versions .Kotlin apply false
79 id(" io.spring.dependency-management" ) version Versions .DependencyManagement apply false
10+ id(" io.codearte.nexus-staging" ) version Versions .NexusStaging
11+ id(" de.marcphilipp.nexus-publish" ) version Versions .NexusPublish apply false
812}
913
1014allprojects {
@@ -15,4 +19,19 @@ allprojects {
1519 mavenCentral()
1620 jcenter()
1721 }
18- }
22+ }
23+
24+ nexusStaging {
25+ username = System .getenv(" SONATYPE_USERNAME" )
26+ password = System .getenv(" SONATYPE_PASSWORD" )
27+ }
28+
29+ subprojects {
30+ apply (plugin = " de.marcphilipp.nexus-publish" )
31+
32+ configure<NexusPublishExtension > {
33+ repositories {
34+ sonatype()
35+ }
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ object Versions {
99 const val SpringBoot = " 2.3.3.RELEASE"
1010 const val SpringCloud = " Hoxton.SR8"
1111 const val DependencyManagement = " 1.0.10.RELEASE"
12+ const val NexusPublish = " 0.4.0"
13+ const val NexusStaging = " 0.22.0"
1214}
Original file line number Diff line number Diff line change 1- package publish
2-
31apply (plugin = " signing" )
4- apply (plugin = " maven-publish" )
52
63val isReleaseVersion = ! version.toString().endsWith(" SNAPSHOT" )
74
85configure<PublishingExtension > {
9- repositories {
10- maven {
11- val releasesRepoUrl = uri( " https://oss.sonatype.org/service/local/staging/deploy/maven2/ " )
12- val snapshotsRepoUrl = uri( " https://oss.sonatype.org/content/repositories/snapshots/ " )
13- name = " center "
14- url = if (isReleaseVersion) releasesRepoUrl else snapshotsRepoUrl
15- credentials {
16- username = System .getenv( " SONATYPE_USERNAME " )
17- password = System .getenv( " SONATYPE_PASSWORD " )
6+ publications {
7+ plugins.findPlugin( JavaPlugin :: class .java)?. let {
8+ create< MavenPublication >( " jar " ) {
9+ from(components[ " java " ] )
10+ }
11+ }
12+ plugins.findPlugin( JavaPlatformPlugin :: class .java)?. let {
13+ create< MavenPublication >( " pom " ) {
14+ from(components[ " javaPlatform " ] )
1815 }
1916 }
2017 }
21-
2218 publications.withType<MavenPublication > {
2319 pom {
2420 name.set(project.name)
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ subprojects {
1313 apply (plugin = " org.jetbrains.kotlin.kapt" )
1414 apply (plugin = " org.jetbrains.kotlin.plugin.spring" )
1515 apply (plugin = " io.spring.dependency-management" )
16- apply (plugin = " publish.jar " )
16+ apply (plugin = " publish" )
1717
1818 dependencyManagement {
1919 imports {
Original file line number Diff line number Diff line change 11plugins {
22 `java- platform`
3- id(" publish.pom " )
3+ id(" publish" )
44}
55
66description = " DevOps Boot Dependencies"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ subprojects {
99 apply (plugin = " java-library" )
1010 apply (plugin = " org.jetbrains.kotlin.jvm" )
1111 apply (plugin = " io.spring.dependency-management" )
12- apply (plugin = " publish.jar " )
12+ apply (plugin = " publish" )
1313
1414 dependencyManagement {
1515 imports {
Original file line number Diff line number Diff line change 11plugins {
22 kotlin(" jvm" )
33 id(" java-gradle-plugin" )
4- id(" publish.base " )
4+ id(" publish" )
55}
66
77description = " DevOps Boot Gradle Plugin"
You can’t perform that action at this time.
0 commit comments