-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: skip -SNAPSHOT suffix if publishing to new portal #738
Conversation
val isPublishingToCentalPortal = | ||
sonatypeCredentialHost.value == Sonatype.sonatypeCentralHost | ||
|
||
if (isSnapshot.value && !isPublishingToCentalPortal) version += "-SNAPSHOT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonatype Central does not accept -SNAPSHOT
versions.
The Central Publisher Portal does not support -SNAPSHOT releases, and deployments of -SNAPSHOT releases will have a version cannot be a SNAPSHOT error in their validation results. Versions should only be published to the Portal if they are intended to reach Maven Central.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, I missed the !
:)
Anyway, I feel it's disingenous for isSnapshot
to be true
but result in a version lacking the -SNAPSHOT
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at how the setting is defined ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, also disingenuous if isSnapshot
is true but it's not published to the snapshot repo?
https://s01.oss.sonatype.org/content/repositories/snapshots/
Here was my idea: I guess the question I have is what does |
My main thought is we should be careful about publishing anything that build tools may consider as a legitimate release. I could only imagine how annoying it would be to get warnings about updating to snapshots... |
I have the same question. When using sbt-typelevel for my projects, with regards to publishing, I always valued that the setup works out of the box. By "works" I mean two main use cases:
In that sense Following that for a second, let's have a look at private def isSnapshot: Boolean =
components.exists {
case a: Version.Component.Alpha => a.isSnapshotIdent
case _: Version.Component.Hash => true
case _ => false
} It defines snapshot as anything that has a hash or is a special case of final case class Alpha(value: String) extends Component {
def isPreReleaseIdent: Boolean = order < 0
def isSnapshotIdent: Boolean = order <= -7
def order: Int =
value.toUpperCase match {
case "SNAP" | "SNAPSHOT" | "NIGHTLY" => -7
case "FEAT" | "FEATURE" => -6
case "ALPHA" | "PREVIEW" => -5
case "BETA" | "B" => -4
case "EA" /* early access */ => -3
case "M" | "MILESTONE" | "AM" => -2
case "RC" => -1
case _ => 0
}
} Back to sbt-typelevel, the current workaround with setting IMO we have two main options for handling publishing to Central Portal
I think I like the first option slightly better, but no hard opinion. |
If it may be useful as a feedback, in my opinion, being a maintainer that came late to the party and is only able to publish to Central Portal, I must accept that the rules have changed and I have no option for publishing SNAPSHOTs anymore. To me, publishing SNAPSHOT stuff in Maven Central is counterintuitive. At least in my case, if I want users to test something before final release, I'll just build an RC. So, from the options enumerated by @majk-p, I'd choose 👇🏽
|
SNAPSHOTS do continue to exist, just not on Sonatype/Maven. For example, it's reasonable to That's why in #739 instead of forcing it to |
Btw, thanks everyone for your thoughtful comments, I appreciate it :) |
You're right, I meant that only in the context of newly created Scala projects that will likely go with Sonatype.
That's something I'd like to avoid, since (if I get it right) eliminates the first use-case I mentioned above. Is that correct? |
If However, if |
Yes, that's right. I guess my real questions should be what's the default |
I think I want to move ahead with #739 but I'm curious if there are any more thoughts. |
Like they say, the best way to find out the answer is sometimes to give the wrong answer first :D |
Just a draft for #735 to kickstart the discussion.
We don't have any scripted tests here, do we?