@@ -1026,15 +1026,15 @@ object Publish extends ScalaCommand[PublishOptions] with BuildCommandHelpers {
1026
1026
Severity .Warning
1027
1027
)
1028
1028
val repoParams0 : RepoParams = repoParams.withAuth(authOpt0)
1029
+ val isLegacySonatype = isSonatype && ! repoParams0.repo.releaseRepo.root.contains(" s01" )
1029
1030
val hooksDataOpt = Option .when(! dummy) {
1030
1031
try repoParams0.hooks.beforeUpload(finalFileSet, isSnapshot0).unsafeRun()(ec)
1031
1032
catch {
1032
1033
case NonFatal (e)
1033
1034
if " Failed to get .*oss\\ .sonatype\\ .org.*/staging/profiles \\ (http status: 403," .r.unanchored.matches(
1034
1035
e.getMessage
1035
1036
) =>
1036
- logger.exit(new WrongSonatypeServerError (
1037
- repoParams0.repo.releaseRepo.root.contains(" s01" )))
1037
+ logger.exit(new WrongSonatypeServerError (isLegacySonatype))
1038
1038
case NonFatal (e)
1039
1039
if " Failed to get .*oss\\ .sonatype\\ .org.*/staging/profiles \\ (http status: 401," .r.unanchored.matches(
1040
1040
e.getMessage
@@ -1096,7 +1096,8 @@ object Publish extends ScalaCommand[PublishOptions] with BuildCommandHelpers {
1096
1096
s """
1097
1097
|Uploading files failed!
1098
1098
|Possible causes:
1099
- |- no rights to push to under this organization or organization name is misspelled
1099
+ |- no rights to publish under this organization
1100
+ |- organization name is misspelled
1100
1101
| -> have you registered your organisation yet?
1101
1102
| """ .stripMargin
1102
1103
)
@@ -1112,7 +1113,9 @@ object Publish extends ScalaCommand[PublishOptions] with BuildCommandHelpers {
1112
1113
|Possible causes:
1113
1114
|- incorrect Sonatype credentials
1114
1115
|- your Sonatype password or username may contain unsupported characters
1115
- |- incorrect Sonatype server was used (legacy or s01)
1116
+ |- incorrect Sonatype server was used, try ${
1117
+ if isLegacySonatype then " 'central-s01'" else " 'central'"
1118
+ }
1116
1119
| -> consult publish subcommand documentation
1117
1120
| """ .stripMargin
1118
1121
)
0 commit comments