src/main/java/com/digitalglobe/util/maven/plugin/CloudFormationDeployMavenPlugin.java
/**
     * Use this method to place the artifact in a s3 bucket.  The method also sets some output parameters that may be
     * used by stacks to work with the artifact.
     *
     * @param s3Client is the S3 API client to use when writing artifacts to an S3 bucket.
     * @param jars is the artifact to place in the bucket.
     * @param filter is an expression in the file name to look for when processing a stack group.
     * @param outputParameters is an array of output parameters where bucket, key, and hash are stored.
     * @throws IOException when the method can't invoke the S3 client.
     * @throws NoSuchAlgorithmException when the method can't generate the hash code for the artifact.
     */
Use this method to place the artifact in a s3 bucket.  The method also sets some output parameters that may be
used by stacks to work with the artifact.

@param s3Client is the S3 API client to use when writing artifacts to an S3 bucket.
@param jars is the artifact to place in the bucket.
@param filter is an expression in the file name to look for when processing a stack group.
@param outputParameters is an array of output parameters where bucket, key, and hash are stored.
@throws IOException when the method can't invoke the S3 client.
@throws NoSuchAlgorithmException when the method can't generate the hash code for the artifact.
Use this method to place the artifact in a s3 bucket . The method also sets some output parameters that may be used by stacks to work with the artifact . @param s3Client is the S3 API client to use when writing artifacts to an S3 bucket . @param jars is the artifact to place in the bucket . @param filter is an expression in the file name to look for when processing a stack group . @param outputParameters is an array of output parameters where bucket key and hash are stored . @throws IOException when the method can ' t invoke the S3 client . @throws NoSuchAlgorithmException when the method can ' t generate the hash code for the artifact .
private void storeArtifact(S3Client s3Client, File[] jars, String filter,
                               Map<String, String> outputParameters)
            throws IOException, NoSuchAlgorithmException {
        File jarFile = getFile(jars, filter);
        audit.write("About to copy " + jarFile.getName() + " to S3.\n");
        String artifactName = s3Prefix != null ? s3Prefix + "/" + jarFile.getName() : jarFile.getName();
        s3Client.putObject(PutObjectRequest.builder().bucket(s3Bucket).key(artifactName).build(),
                RequestBody.fromFile(jarFile));
        audit.write(artifactName + " was copied to the s3 bucket (" + s3Bucket + ").\n");
        String sb = getBase64SHA256HashString(jarFile);
        audit.write("Base64 Encoded SHA256 HASH value: " + sb + "\n");
        outputParameters.put("ArtifactS3Bucket", s3Bucket);
        outputParameters.put("ArtifactS3Key", artifactName);
        outputParameters.put("CodeSHA256", sb);
    }
private void storeArtifact ( S3Client s3Client , File [ ] jars , String filter , Map < String , String > outputParameters ) throws IOException , NoSuchAlgorithmException { File jarFile = getFile ( jars , filter ) ; audit . write ( "About to copy " + jarFile . getName ( ) + " to S3.\n" ) ; String artifactName = s3Prefix != null ? s3Prefix + "/" + jarFile . getName ( ) : jarFile . getName ( ) ; s3Client . putObject ( PutObjectRequest . builder ( ) . bucket ( s3Bucket ) . key ( artifactName ) . build ( ) , RequestBody . fromFile ( jarFile ) ) ; audit . write ( artifactName + " was copied to the s3 bucket (" + s3Bucket + ").\n" ) ; String sb = getBase64SHA256HashString ( jarFile ) ; audit . write ( "Base64 Encoded SHA256 HASH value: " + sb + "\n" ) ; outputParameters . put ( "ArtifactS3Bucket" , s3Bucket ) ; outputParameters . put ( "ArtifactS3Key" , artifactName ) ; outputParameters . put ( "CodeSHA256" , sb ) ; }
Use this method to place the artifact in a s3 bucket.
Use this method to place the artifact in a s3 bucket .