1
1
plugins {
2
- id ' java-gradle-plugin'
3
- id ' maven-publish'
4
- id ' signing'
5
2
id ' net.researchgate.release' version ' 3.0.0'
6
- id ' com.gradle.plugin-publish' version ' 0.21 .0'
3
+ id ' com.gradle.plugin-publish' version ' 1.3 .0'
7
4
id ' org.jreleaser' version ' 1.15.0'
8
5
}
9
6
10
7
apply from : ' gradle/integration-test.gradle'
11
8
9
+ // Plugin publishing configuration
12
10
def pluginDescription = ' Scan, evaluate and audit Gradle projects using Sonatype platforms'
11
+ def pluginUrl = ' https://github.com/sonatype-nexus-community/scan-gradle-plugin'
13
12
14
13
gradlePlugin {
15
14
plugins {
@@ -18,6 +17,11 @@ gradlePlugin {
18
17
implementationClass = ' org.sonatype.gradle.plugins.scan.ScanPlugin'
19
18
displayName = project. name
20
19
description = pluginDescription
20
+ website = pluginUrl
21
+ vcsUrl = pluginUrl
22
+ tags. set([' sonatype' , ' scan' , ' dependencies' , ' ossindex' , ' iq server' , ' lifecycle' ])
23
+ System . setProperty(' gradle.publish.key' , System . getenv(' GRADLE_PUBLISH_KEY' ) ?: ' ' )
24
+ System . setProperty(' gradle.publish.secret' , System . getenv(' GRADLE_PUBLISH_SECRET' ) ?: ' ' )
21
25
}
22
26
}
23
27
}
@@ -134,24 +138,11 @@ publishing {
134
138
}
135
139
}
136
140
137
-
138
- // Plugin publishing configuration
139
- def pluginUrl = ' https://github.com/sonatype-nexus-community/scan-gradle-plugin'
140
- pluginBundle {
141
- website = pluginUrl
142
- vcsUrl = pluginUrl
143
- description = pluginDescription
144
- tags = [' sonatype' , ' scan' , ' dependencies' , ' ossindex' , ' iq server' ]
145
- System . setProperty(' gradle.publish.key' , System . getenv(' GRADLE_PUBLISH_KEY' ) ?: ' ' )
146
- System . setProperty(' gradle.publish.secret' , System . getenv(' GRADLE_PUBLISH_SECRET' ) ?: ' ' )
147
- }
148
-
149
-
150
141
jreleaser {
151
142
project {
152
143
name = ' scan-gradle-plugin'
153
- description = ' Scan, evaluate and audit Gradle projects using Sonatype platforms '
154
- website = ' https://github.com/sonatype-nexus-community/scan-gradle-plugin '
144
+ description = pluginDescription
145
+ website = pluginUrl
155
146
}
156
147
signing {
157
148
active = ' ALWAYS'
@@ -167,7 +158,6 @@ jreleaser {
167
158
if (secretKey) {
168
159
System . setProperty(' jreleaser.gpg.secret.key' , secretKey)
169
160
}
170
-
171
161
}
172
162
deploy {
173
163
maven {
@@ -183,5 +173,17 @@ jreleaser {
183
173
}
184
174
}
185
175
176
+ // Remove unwanted "scan" directory after publishing
177
+ tasks. register(' cleanupUnwantedArtifacts' ) {
178
+ doLast {
179
+ def unwantedDir = file(" build/staging-deploy/org/sonatype/gradle/plugins/scan" )
180
+ if (unwantedDir. exists()) {
181
+ println " Removing unwanted directory: $unwantedDir "
182
+ delete unwantedDir
183
+ }
184
+ }
185
+ }
186
+
186
187
afterReleaseBuild. dependsOn publish
187
- // publish.finalizedBy publishPlugins
188
+ publish. finalizedBy cleanupUnwantedArtifacts
189
+ publish. finalizedBy publishPlugins
0 commit comments