fix release publishing

This commit is contained in:
Steve Ebersole 2024-12-03 22:29:47 -06:00
parent 11afe4781b
commit a1b4773496

View File

@ -62,9 +62,9 @@ task publish {
} }
ext { ext {
if ( project.hasProperty( 'hibernatePublishUsername' ) ) { if ( project.hasProperty( 'OSSRH_USER' ) ) {
if ( ! project.hasProperty( 'hibernatePublishPassword' ) ) { if ( ! project.hasProperty( 'OSSRH_PASSWORD' ) ) {
throw new GradleException( "Should specify both `hibernatePublishUsername` and `hibernatePublishPassword` as project properties" ); throw new GradleException( "Should specify both `OSSRH_USER` and `OSSRH_PASSWORD` as project properties" );
} }
} }
} }
@ -72,8 +72,8 @@ ext {
nexusPublishing { nexusPublishing {
repositories { repositories {
sonatype { sonatype {
username = project.hasProperty( 'hibernatePublishUsername' ) ? project.property( 'hibernatePublishUsername' ) : null username = project.hasProperty( 'OSSRH_USER' ) ? project.property( 'OSSRH_USER' ) : null
password = project.hasProperty( 'hibernatePublishPassword' ) ? project.property( 'hibernatePublishPassword' ) : null password = project.hasProperty( 'OSSRH_PASSWORD' ) ? project.property( 'OSSRH_PASSWORD' ) : null
} }
} }
} }
@ -94,11 +94,11 @@ gradle.taskGraph.addTaskExecutionGraphListener(
if ( graph.hasTask( taskToLookFor ) ) { if ( graph.hasTask( taskToLookFor ) ) {
// trying to publish - make sure the needed credentials are available // trying to publish - make sure the needed credentials are available
if ( project.property( 'hibernatePublishUsername' ) == null ) { if ( project.property( 'OSSRH_USER' ) == null ) {
throw new RuntimeException( "`-PhibernatePublishUsername=...` not found" ) throw new RuntimeException( "`-POSSRH_USER=...` not found" )
} }
if ( project.property( 'hibernatePublishPassword' ) == null ) { if ( project.property( 'OSSRH_PASSWORD' ) == null ) {
throw new RuntimeException( "`-PhibernatePublishPassword=...` not found" ) throw new RuntimeException( "`-POSSRH_PASSWORD=...` not found" )
} }
break; break;