File tree Expand file tree Collapse file tree 2 files changed +28
-15
lines changed
contrib/sonatypecentral/src/mill/contrib/sonatypecentral
scalalib/src/mill/scalalib Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -87,16 +87,23 @@ class SonatypeCentralPublisher(
8787 publishingType : PublishingType
8888 ): Unit = {
8989 try {
90- sonatypeCentralClient.uploadBundleFromFile(
91- zipFile,
92- deploymentName,
93- Some (publishingType),
94- timeout = awaitTimeout
95- )
90+ mill.api.Retry (
91+ count = 5 ,
92+ backoffMillis = 1000 ,
93+ filter = (_, ex) => ex.getMessage.contains(" Read end dead" )
94+ ) {
95+ sonatypeCentralClient.uploadBundleFromFile(
96+ zipFile,
97+ deploymentName,
98+ Some (publishingType),
99+ timeout = awaitTimeout
100+ )
101+ }
96102 } catch {
97103 case ex : Throwable => {
98104 throw new RuntimeException (
99- s " Failed to publish ${deploymentName.unapply} to Sonatype Central. Error: \n ${ex.getMessage}"
105+ s " Failed to publish ${deploymentName.unapply} to Sonatype Central " ,
106+ ex
100107 )
101108 }
102109
Original file line number Diff line number Diff line change @@ -87,19 +87,25 @@ class SonatypeCentralPublisher(
8787 publishingType : PublishingType
8888 ): Unit = {
8989 try {
90- sonatypeCentralClient.uploadBundleFromFile(
91- zipFile,
92- deploymentName,
93- Some (publishingType),
94- timeout = awaitTimeout
95- )
90+ mill.api.Retry (
91+ count = 5 ,
92+ backoffMillis = 1000 ,
93+ filter = (_, ex) => ex.getMessage.contains(" Read end dead" )
94+ ) {
95+ sonatypeCentralClient.uploadBundleFromFile(
96+ zipFile,
97+ deploymentName,
98+ Some (publishingType),
99+ timeout = awaitTimeout
100+ )
101+ }
96102 } catch {
97103 case ex : Throwable => {
98104 throw new RuntimeException (
99- s " Failed to publish ${deploymentName.unapply} to Sonatype Central. Error: \n ${ex.getMessage}"
105+ s " Failed to publish ${deploymentName.unapply} to Sonatype Central " ,
106+ ex
100107 )
101108 }
102-
103109 }
104110
105111 log.info(s " Successfully published ${deploymentName.unapply} to Sonatype Central " )
You can’t perform that action at this time.
0 commit comments