andylamax
11/26/2020, 9:15 PMio.codearte.nexus-staging
is so flaky. i get timeouts which hinders Continuous Delivery a lotVampire
11/26/2020, 9:33 PMandylamax
11/26/2020, 10:21 PMVampire
11/26/2020, 10:32 PMandylamax
11/26/2020, 10:37 PMDEPRECATION WARNING. The staging repository ID is not provided. The fallback mode may impact release reliability and is deprecated. Please consult the project FAQ how it can be fixed.
Attempt 61/61 failed. WrongNumberOfRepositories was thrown with message 'Wrong number of received repositories in state 'open'. Expected 1, received 3'. Giving up. Configure longer timeout if necessary.
Vampire
11/26/2020, 10:39 PMandylamax
11/26/2020, 10:59 PMVampire
11/27/2020, 12:41 AMio.codearte.nexus-staging
can operate in two ways when closing a repository.
Either "you" told it the id of the repository it should close,
or if not then it queries all open repositories and expects to find exactly one.
If it finds not exactly one (0 or more than one) it retries the configured amount of times and then fails
if not found exactly one, as it cannot guess which one is the one it should close.
This also means, that if there are unclosed repositories for example due to half-finished releases,
future release tries will not succeed unless you log in and close or delete all open repositories.
Why I asked about TravisCI is, because when releaseing from TravisCI there is a significant problem.
Outgoing requests often have changing IPs.
And when uploading files to Nexus without specifying a repository id, then it will group them by IP.
Meaning if you upload all files from the same IP, they will end up in the same repository,
but if you upload from changing IPs, multiple repositories are created and then the heuristic with one unclosed repository does not work.
Thankfully there is another plugin that provides a solution which is called de.marcphilipp.nexus-publish
and cooperates nicely with io.codearte.nexus-staging
.
It up-front explicitly creates a staging repository, configures the publishing repository with an URL with the explicit repository id so that all uploads land in the repository and if the io.codearte.nexus-staging
plugin is also applied, then configures the staging repository id on its extensions, so that it exactly knows which repository to close and does not need any heuristics.
Also you asked for an example where it works, so here you have it: https://github.com/Vampire/command-framework/blob/master/buildSrc/src/main/kotlin/net/kautler/publishing.gradle.ktsandylamax
11/27/2020, 4:33 AMVampire
11/27/2020, 8:18 AMhttps://i.ytimg.com/vi/WO1kLCb8K54/maxresdefault.jpgā¾
andylamax
11/27/2020, 10:00 AM