Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Error: "The specified key does not exist" when passing S3 prefix as the only value of <keys> field. #74

@desmond27

Description

@desmond27

When I pass the S3 prefix of the objects that I want downloaded before packaging, I get the following error:

Failed to execute goal com.gkatzioura.maven.cloud:s3-storage-wagon:2.3:s3-download (download-multiple-files-to-one-directory) on project TestProject: Execution download-multiple-files-to-one-directory of goal com.gkatzioura.maven.cloud:s3-storage-wagon:2.3:s3-download failed: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: REDACTED; S3 Extended Request ID: REDACTED) -> [Help 1]

The execution config is as follows:

<execution>
    <id>download-multiple-files-to-one-directory</id>
    <phase>prepare-package</phase>
    <goals>
        <goal>s3-download</goal>
    </goals>
    <configuration>
        <bucket>plugins-bucket</bucket>
        <downloadPath>WebContent\WEB-INF</downloadPath>
        <keys>Plugins</keys>
    </configuration>
</execution>

Going through the code in S3DownloadMojo.java I have come across the following lines:

if (keys.size()==1) {
    downloadSingleFile(amazonS3,keys.get(0));
    return;
}

Here downloadSingleFile() is set to only download a single file if the number of keys given is one. Could this be enhanced to recursively fetch all objects under the given prefix via another configuration parameter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions