使用Maven与S3存储桶同步文件

时间:2018-08-28 02:18:11

标签: maven amazon-web-services amazon-s3

我正在尝试通过Maven将压缩包上传到S3存储桶。在我的POM文件中,我有:

<!-- upload the war file from our repository -->
<execution>
    <phase>deploy</phase>
    <goals>
        <goal>java</goal>
    </goals>
    <id>upload-war</id>
    <configuration>               
        <includeProjectDependencies>true</includeProjectDependencies>         
        <includePluginDependencies>true</includePluginDependencies>
        <classpathScope>runtime</classpathScope>
        <executableDependency>
            <groupId>net.java.dev.jets3t</groupId>
            <artifactId>jets3t</artifactId>
        </executableDependency>
        <mainClass>org.jets3t.apps.synchronize.Synchronize</mainClass>
            <arguments>
                <argument>--nodelete</argument>
                <argument>--properties</argument>
                <argument>${project.basedir}/aws.properties</argument>
                <argument>UP</argument>
                <argument>${aws.s3.release-bucket}</argument>
                <argument>${stack.war}</argument>
            </arguments>
      </configuration>
 </execution>

在属性aws.properties文件中,我的AWS账户有accesskeysecretkey

我收到以下错误:

SEVERE: A thread failed with an exception. Firing ERROR event and cancelling all threads
org.jets3t.service.ServiceException: S3 Error Message. GET '/' on Host 'fs-ug-cloudformation.s3.amazonaws.com' @ 'Tue, 28 Aug 2018 02:00:18 GMT' -- ResponseCode: 400, ResponseStatus: Bad Request, XML Error Message: 
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidRequest</Code>
  <Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message>
  <RequestId>BF901EF5C1FAD735</RequestId>
  <HostId>...</HostId>
</Error>

我尝试添加regionsignature_version属性,但仍然遇到相同的错误。我知道我的区域ca-central-1a需要AWS4-HMAC-SHA2561身份验证。

我想念什么吗?

0 个答案:

没有答案