HHH-15765 Fix build failure by upgrade nu.studer.credentials to 3.0

This commit is contained in:
Mark Rotteveel 2022-11-26 15:19:57 +01:00 committed by Christian Beikov
parent 86b28f4c8d
commit c71d1b3bef
2 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ plugins {
id 'biz.aQute.bnd' version '6.3.1' apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'nu.studer.credentials' version '2.1'
id 'nu.studer.credentials' version '3.0'
id 'idea'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
@ -81,8 +81,8 @@ ext {
nexusPublishing {
repositories {
sonatype {
username = credentials.hibernatePublishUsername
password = credentials.hibernatePublishPassword
username = credentials.forKey( 'hibernatePublishUsername' )
password = credentials.forKey( 'hibernatePublishPassword' )
}
}
}
@ -103,10 +103,10 @@ gradle.taskGraph.addTaskExecutionGraphListener(
if ( graph.hasTask( taskToLookFor ) ) {
// trying to publish - make sure the needed credentials are available
if ( credentials.hibernatePublishUsername == null ) {
if ( credentials.forKey( 'hibernatePublishUsername' ) == null ) {
throw new GradleException( "Publishing credentials not specified" );
}
if ( credentials.hibernatePublishPassword == null ) {
if ( credentials.forKey( 'hibernatePublishPassword' ) == null ) {
throw new GradleException( "Publishing credentials not specified" );
}

View File

@ -154,14 +154,14 @@ gradle.taskGraph.whenReady { tg ->
}
else {
// use the values from the credentials provider, if any
if ( credentials.hibernatePluginPortalUsername == null ) {
if ( credentials.forKey( 'hibernatePluginPortalUsername' ) == null ) {
throw new RuntimeException( "`hibernatePluginPortalUsername` not found" )
}
if ( credentials.hibernatePluginPortalPassword == null ) {
if ( credentials.forKey( 'hibernatePluginPortalPassword' ) == null ) {
throw new RuntimeException( "`hibernatePluginPortalPassword` not found" )
}
System.setProperty( 'gradle.publish.key', credentials.hibernatePluginPortalUsername )
System.setProperty( 'gradle.publish.secret', credentials.hibernatePluginPortalPassword )
System.setProperty( 'gradle.publish.key', credentials.forKey( 'hibernatePluginPortalUsername' ) )
System.setProperty( 'gradle.publish.secret', credentials.forKey( 'hibernatePluginPortalPassword') )
}
}
}