|
DeployingAnExistingWarFile
How to deploy an existing war file
Deploying an existing warYou can use the maven plugin to deploy a war file that was built by some other means such as an ANT screen. You simply create a simple maven project that deploys a WAR file stored in S3. First create a new directory. Second, in that directory create a pom.xml (with the appropriate edits): <project>
<modelVersion>4.0.0</modelVersion>
<groupId>net.chrisrichardson</groupId>
<artifactId>standalone-deployment</artifactId>
<version>1.0</version>
<repositories>
<repository>
<id>pia-repository</id>
<url>http://www.pojosinaction.com/repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>pia-repository</id>
<url>http://www.pojosinaction.com/repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
<aws.properties>PATH_TO_YOUR_AWS_PROPERTIES</aws.properties>
<s3.war>s3://YOURBUCKET/YOUR_WAR.war</s3.war>
</properties>
<build>
<plugins>
<plugin>
<groupId>net.chrisrichardson</groupId>
<artifactId>cloudtools-maven-plugin</artifactId>
<configuration>
<awsPropertiesFile>${aws.properties}</awsPropertiesFile>
<schemaName>YOUR_SCHEMA</schemaName>
<schemaUsers>
<param>YOUR_DB_USER:YOUR_DB_PASSWORD</param>
</schemaUsers>
<warDirectory>${s3.war}</warDirectory>
<warName>mywar</warName>
<numberOfMySqlSlaves>0</numberOfMySqlSlaves>
<numberOfTomcats>1</numberOfTomcats>
<topology>SingleInstanceTopology</topology>
<catalinaOptsBuilder>
<![CDATA[
{builder, databasePrivateDnsName, slaves ->
builder.arg("-server")
builder.arg("-Xmx1000m")
builder.arg("-Xms1000m")
builder.prop("jdbc.db.server", databasePrivateDnsName)
}
]]>
</catalinaOptsBuilder>
</configuration>
</plugin>
</plugins>
</build>
</project>
Third, upload your war file to S3 You should now be able run "mvn cloudtools:deploy" to deploy your application on EC2. |
► Sign in to add a comment
I am trying to deploy application using Maven cloudtools plugin,
I did same 3 steps above mentioned , but maven is not able download the cloudtools plugin, it is asking version . please can you help me to install maven cloudtools plugin . thanks in advance.