typedb/bazel-distribution

Can't deploy maven snapshots

Closed this issue · 5 comments

This may be known/intentional or I may be completely wrong so I thought I'd write this up to check and potentially as ad-hoc documentation?

I've been looking at publishing snapshots to oss.sonatype.org.

I came across a few issues:

  1. deploy.py wants a (git) sha for the version. maven/Sonatype want a -SNAPSHOT suffix.
  2. The maven 3 SNAPSHOT model wants automatic versioning (changing SNAPSHOT to timestamp in filenames) and the writing of maven-metadata.xml to record this.

It is possible to disable the check in deploy.py and push a SNAPSHOT suffix without the extra behavior above. Documentation seems to indicate maven 3 will never write this format. Not sure if the various clients will read it (and it has a lot of other negative behaviors related to caching anyway ...)

Do I have this right? Anything I'm missing?

Thanks!

Hi! Currently, it is not possible to do so. Unfortunately, deploying a SNAPSHOT artifact isn't in our use case.

Curious about this too.

Unfortunately, deploying a SNAPSHOT artifact isn't in our use case.

I'm curious why the current sha regex is used - does that result in valid snapshot artifacts for graknlab's use case?

Would it be possible to optionally bypass/override the snapshot regex that's enforced in deploy.py via an attribute on the deploy_maven rule?

I'm curious why the current sha regex is used - does that result in valid snapshot artifacts for graknlab's use case?
It would result in valid snapshot artifacts for our usage - as internally we avoid the use of -SNAPTSHOT / non-versioned artifacts.

Would it be possible to optionally bypass/override the snapshot regex that's enforced in deploy.py via an attribute on the deploy_maven rule?

Yes. bazel-distribution is meant to be generic enough for general use. Feel free to submit a PR changing the regex to allow for a normal Maven SNAPSHOT version. Here's the regex in question:
https://github.com/graknlabs/bazel-distribution/blob/master/maven/templates/deploy.py#L114

Awesome. Should I simply extend the existing regex to also allow normal SNAPSHOT versions as well (i.e. ^[0-9|a-f|A-F]{40}$|.*-SNAPSHOT$ )?

Or would you rather I make it configurable? Personally I lean towards simply extending the regex as it has lower maintenance overhead and I don't suspect there's many use cases with non-standard snapshot naming conventions. Wdyt?

Awesome. Should I simply extend the existing regex to also allow normal SNAPSHOT versions as well (i.e. ^[0-9|a-f|A-F]{40}$|.*-SNAPSHOT$ )?

Cool! I think this is preferable. We'd like to keep it low maintenance ;)