microsoft / mvnfeed-cli

Tool to transfer Maven artifacts between repositories
MIT License
25 stars 25 forks source link

Missing checksum files #17

Closed ja6a-regnosys closed 1 month ago

ja6a-regnosys commented 1 month ago

I managed to get this to run - referring to the other issues. I am using python 3.11.2. I have a problem whereby the script is ignoring the checksum files - in my case sha1 files. I added some blocks so that the checksums are also downloaded. The upload routine fails however with {"error":"Request contains an invalid argument."}. Any help?

Modified function:

def _java_artifacts(artifact_fullname, artifact_type, artifact_path, transfer_deps):
    return [
        {
            'name': artifact_fullname + '.' + artifact_type,
            'path': artifact_path,
            'target': True
        },
        {
            'name': artifact_fullname + '.pom',
            'path': artifact_path,
            'transfer_deps': transfer_deps,
            'target': False
        },
        {
            'name': artifact_fullname + '-tests.jar',
            'path': artifact_path,
            'target': False
        },
        {
            'name': artifact_fullname + '-sources.jar',
            'path': artifact_path,
            'target': False
        },
        {
            'name': artifact_fullname + '-javadoc.jar',
            'path': artifact_path,
            'target': False
        },
        ## Modifications from here
        {
            'name': artifact_fullname + '.jar.sha1',
            'path': artifact_path,
            'target': False
        },
        {
            'name': artifact_fullname + '.pom.sha1',
            'path': artifact_path,
            'target': False
        }
    ]
ja6a-regnosys commented 1 month ago

The reason the checksum files were not being uploaded was because they were being handled in the same way as jar files - i.e. binary multipart file uploads - as opposed to pom files - which are treated as text.