What would it need to create a flatDir s3 artifact repository?

Hey guys,

given i wanna have an flatDir as repository which does not point to a local directory like FlatDirectoryArtifactRepository but which uses Amazon’s s3 API to point to a s3 bucket. Can you provide me with some pointers on how to achieve that !?

best Johannes

Adrian Kelly has been working on S3 support for Gradle. It’s just made it into the nightlies, but it hasn’t made it to a final release yet. It’s pretty new, but feedback is always appreciated.

Hey Johannes, you might be able to do that by configuring a s3 backed ivy repository with a custom artifact pattern:

repositories {
    ivy {
        url "s3://someS3Bucket/ivy"
        credentials(AwsCredentials) {
            accessKey "someKey"
            secretKey "someSecret"
        }
        artifactPattern "[artifact]-[revision].[ext]"
    }
}

As Sterling already pointed out, this is in master only and might change as it is under active development

Johannes,

You can try out the new s3 support using a nightly release. See here on how to configure the Gradle wrapper to use a nightly.

Depending on how/why you are using a flatDir repository it may make sense to to use a remote s3 ivy or maven repository anyways. i.e. you need to both publish and resolve versioned artifacts.

There’s also this plugin which can be used to sync with S3 buckets.

Hey thanks all for the input, that sounds very promising, i will try that!

As it concerns the background… Currently we have multiple flatDir repositories inside our git project, multiple because we compile/build our product for dozen of multiple variants of the same project (Hadoop - different versions, different vendors). We like the simplicity (just but the jar’s for that Hadoop version in that one folder) and the offline capability (checkout the git project and for sure you have something working). However since the binary load in our project is getting too heavy we are willing to sacrifice the offline capability, at least part wise.

Are there major differences between using the flatDir and the ivy variant of it ?