@@ -28,7 +28,6 @@ import wooga.gradle.github.publish.PublishMethod.update
2828import wooga.gradle.github.publish.tasks.GithubPublish
2929import java.awt.GraphicsEnvironment.isHeadless
3030import java.util.concurrent.CompletableFuture
31- import javax.naming.ConfigurationException
3231import javax.swing.JButton
3332import javax.swing.JFrame
3433import javax.swing.JOptionPane.DEFAULT_OPTION
@@ -74,18 +73,8 @@ extra["github.token"] = optionalString(project, "github.token").getValue()
7473
7574tasks.withType<PublishToMavenRepository >().configureEach {
7675 doFirst(" verify username and password are set" ) {
77- if (sonatypeUsername.isNullOrBlank()) {
78- throw ConfigurationException (
79- " Please set the Sonatype username with project property 'sonatype.username' " +
80- " or '${rootProject.name} .sonatype.username'. " +
81- " If both are set, the latter will be effective." )
82- }
83- if (sonatypePassword.isNullOrBlank()) {
84- throw ConfigurationException (
85- " Please set the Sonatype password with project property 'sonatype.password' " +
86- " or '${rootProject.name} .sonatype.password'. " +
87- " If both are set, the latter will be effective." )
88- }
76+ sonatypeUsername.verifyPropertyIsSet(" sonatypeUsername" , rootProject.name)
77+ sonatypePassword.verifyPropertyIsSet(" sonatypePassword" , rootProject.name)
8978 }
9079}
9180
@@ -190,25 +179,10 @@ tasks.withType<BaseStagingTask>().configureEach {
190179
191180 doFirst(" verify username, password and staging profile id are set" ) {
192181 if (this !is GetStagingProfileTask ) {
193- if (sonatypeStagingProfileId.isNullOrBlank()) {
194- throw ConfigurationException (
195- " Please set the Sonatype staging profile id with project property 'sonatype.stagingProfileId' " +
196- " or '${rootProject.name} .sonatype.stagingProfileId'. " +
197- " If both are set, the latter will be effective." )
198- }
199- }
200- if (sonatypeUsername.isNullOrBlank()) {
201- throw ConfigurationException (
202- " Please set the Sonatype username with project property 'sonatype.username' " +
203- " or '${rootProject.name} .sonatype.username'. " +
204- " If both are set, the latter will be effective." )
205- }
206- if (sonatypePassword.isNullOrBlank()) {
207- throw ConfigurationException (
208- " Please set the Sonatype password with project property 'sonatype.password' " +
209- " or '${rootProject.name} .sonatype.password'. " +
210- " If both are set, the latter will be effective." )
182+ sonatypeStagingProfileId.verifyPropertyIsSet(" sonatypeStagingProfileId" , rootProject.name)
211183 }
184+ sonatypeUsername.verifyPropertyIsSet(" sonatypeUsername" , rootProject.name)
185+ sonatypePassword.verifyPropertyIsSet(" sonatypePassword" , rootProject.name)
212186 }
213187}
214188
@@ -354,6 +328,7 @@ val finishMilestone by tasks.registering {
354328}
355329
356330tasks.beforeReleaseBuild {
331+ dependsOn(tasks.named(" integTest" ))
357332 dependsOn(tasks.named(" pitest" ))
358333}
359334
0 commit comments