Fork me on GitHub jcabi

26-Sep-2013 0.9.2

Deploying WAR projects to AWS Elastic Beanstalk

Create new application in Amazon Elastic Beanstalk.

Configure running environment and save configuration template. Don't forget that you can customize your app with configuration files as explained here.

Configure jcabi-beanstalk-maven-plugin in your pom.xml:

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi-beanstalk-maven-plugin</artifactId>
        <version>0.9.2</version>
        <configuration>
          <name>example</name>
          <bucket>webapps.example.com</bucket>
          <key>${project.artifactId}-${project.version}.war</key>
          <template>example</template>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Run mvn deploy.

That's all you need. Application name has to be the same as the CNAME of environment. Server has to be defined in settings.xml with username and password (AWS IAM key and secret key).

If you have any problems - don't hesitate to submit a ticket to github.

Cutting Edge Version

If you want to use current version of the product, you can do it with this configuration in your pom.xml:

<pluginRepositories>
  <pluginRepository>
    <id>oss.sonatype.org</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </pluginRepository>
</pluginRepositories>
<build>
  <plugins>
    <plugin>
      <groupId>com.jcabi</groupId>
      <artifactId>jcabi-beanstalk-maven-plugin</artifactId>
      <version>1.0-SNAPSHOT</version>
      [...]
    </plugin>
  </plugins>
</build>

Copyright © 2012-2013 jcabi.com, All Rights Reserved. Privacy Policy.

site is built by Apache Maven