-
Notifications
You must be signed in to change notification settings - Fork 73
Add central support #612
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
Add central support #612
Conversation
…entralReleaseMojo.java as the functionality is now fully integrated with the DeployMojo.
…loyMojo and remove CentralBundleMojo. Fix verify scripts in central-zip-bundles and central-zip-megabundle.
… (but is not yet finished)
…Prun-its verify' runs successfully.
| } | ||
| } | ||
|
|
||
| public File generateChecksum(File file, String algo) throws NoSuchAlgorithmException, IOException { |
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.
You really want to redo what Resolver does for you out of the box?
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.
no, i want to reuse as much existing functionality as possible of course :) I'll try to use resolver for checksums instead then thanks!
| * <li>Developers information</li> | ||
| * </ul> | ||
| */ | ||
| private void validateForPublishing(File pomFile) throws MojoExecutionException { |
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.
This validation is off: license, SCM, developers are usually defined in top level POM only
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.
I'll adjust it if it does not get too complex. Otherwise i'll remove this and let central validation handle it.
| } | ||
| } | ||
|
|
||
| private String[] resolveCredentials(String serverId) throws MojoExecutionException { |
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.
HTTP proxy?
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.
Should we perhaps use a library for the upload communication part. httpclient perhaps?
| while ((bytesRead = is.read(buffer)) != -1) { | ||
| dos.write(buffer, 0, bytesRead); | ||
| public List<File> generateChecksums(File file, List<String> algos) throws IOException { | ||
| Map<String, Object> results = ChecksumUtils.calc(file, algos); |
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.
|
Retracted after discussion on the dev list. |
Following this checklist to help us incorporate your
contribution quickly and easily:
Your pull request should address just one issue, without pulling in other changes.
Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
This PR adds support for the new central portal publish api described here: https://central.sonatype.org/publish/publish-portal-api/. Essentially it generates checksum files for all artifacts, creates a zip bundle and uploads that to central.
All the current functionality remains intact and the result is controlled with a few additional properties i.e.
deployAtEnd(that existed before) determines whether all sub-projects should be deployed in one go or not.useCentralPortalApidetermines whether the Deploy plugin should behave as it does currently (useCentralPortalApi=false) or behave as per the requirements of the central portal publish api (useCentralPortalApi=true).autoDeployif set to true the deployment will automatically proceed to publish after validation. If false it will wait for manual action at central.uploadToCentralif set to false, only the zip bundle will be created but not deployed to central.Both unit tests and IT tests have been created to clearly showcase (and test) the new functionality.
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
Both sunny and rainy day unit tests have been created. IT tests cover only sunny day scenarios.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
ICLA already exists.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.