title: How to deploy an artifact into Amazon S3 with Maven?
body: <p>I'm trying to follow these tutorials (<a href="http://jmchung.github.io/blog/2015/03/01/using-amazon-s3-as-a-private-maven-repository/" rel="noreferrer">1</a>,<a href="http://www.yegor256.com/2015/09/07/maven-repository-amazon-s3.html" rel="noreferrer">2</a>) to achieve the mentioned goal. But I'm still getting this error from Maven:</p>
  
  <pre><code>INFO] Installing /home/valter/temp-workspace/document-engine/target/application-1.0.0.CI-SNAPSHOT.jar to /home/valter/.m2/repository/com/company-solutions/application/1.0.0.CI-SNAPSHOT/application-1.0.0.CI-SNAPSHOT.jar
  [INFO] Installing /home/valter/temp-workspace/document-engine/pom.xml to /home/valter/.m2/repository/com/company-solutions/application/1.0.0.CI-SNAPSHOT/application-1.0.0.CI-SNAPSHOT.pom
  [INFO] 
  [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ application ---
  Downloading: s3://myrepo.company.solutions/snapshot/com/company-solutions/application/1.0.0.CI-SNAPSHOT/maven-metadata.xml
  [WARNING] s3://myrepo.company.solutions/snapshot - Connection refused
  [WARNING] Could not transfer metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml from/to s3.snapshot (s3://myrepo.company.solutions/snapshot): Could not connect to repository
  [INFO] Logged off - myrepo.company.solutions
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:31 min
  [INFO] Finished at: 2015-11-16T18:36:26+01:00
  [INFO] Final Memory: 181M/1289M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project application: Failed to retrieve remote metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.company-solutions:application:1.0.0.CI-SNAPSHOT/maven-metadata.xml from/to s3.snapshot (s3://myrepo.company.solutions/snapshot): Could not connect to repository: Status Code: 400, AWS Service: Amazon S3, AWS Request ID: 709B60A05E8E7062, AWS Error Code: InvalidRequest, AWS Error Message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>These are my local files, <strong>~.m2/settings.xml</strong> (with fictious values, of course):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
        http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
      &lt;servers&gt;
          &lt;server&gt;
              &lt;id&gt;s3.site&lt;/id&gt;
              &lt;username&gt;access_key&lt;/username&gt;
              &lt;password&gt;private_key&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;s3.release&lt;/id&gt;
              &lt;username&gt;access_key&lt;/username&gt;
              &lt;password&gt;private_key&lt;/password&gt;
          &lt;/server&gt;
          &lt;server&gt;
              &lt;id&gt;s3.snapshot&lt;/id&gt;
              &lt;username&gt;access_key&lt;/username&gt;
              &lt;password&gt;private_key&lt;/password&gt;
          &lt;/server&gt;
      &lt;/servers&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>And my <strong>pom.xml</strong>:</p>
  
  <pre><code>&lt;project&gt;
      &lt;build&gt;
          &lt;extensions&gt;
              &lt;extension&gt;
                  &lt;groupId&gt;org.kuali.maven.wagons&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-s3-wagon&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;/extension&gt;
          &lt;/extensions&gt;
          ...
      &lt;/build&gt;
      &lt;distributionManagement&gt;
          &lt;site&gt;
              &lt;id&gt;s3.site&lt;/id&gt;
              &lt;url&gt;s3://myrepo.company.solutions/site&lt;/url&gt;
          &lt;/site&gt;
          &lt;repository&gt;
              &lt;id&gt;s3.release&lt;/id&gt;
              &lt;url&gt;s3://myrepo.company.solutions/release&lt;/url&gt;
          &lt;/repository&gt;
          &lt;snapshotRepository&gt;
              &lt;id&gt;s3.snapshot&lt;/id&gt;
              &lt;url&gt;s3://myrepo.company.solutions/snapshot&lt;/url&gt;
          &lt;/snapshotRepository&gt;
      &lt;/distributionManagement&gt;
  ...
  &lt;/project&gt;
  </code></pre>
  
  <p>I'm using Maven 3.3.3.</p>
  
  <p><strong>EDIT</strong>
  This is my policy simulator result:
  <a href="https://i.stack.imgur.com/4Pjbh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4Pjbh.png" alt="enter image description here"></a></p>