Skip to content

Commit 15354a1

Browse files
committed
Added Maven assembly instructions
1 parent d04a3dd commit 15354a1

File tree

1 file changed

+78
-1
lines changed

1 file changed

+78
-1
lines changed

README.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,87 @@ A modified version of Tomcat v7.0.29 to run on [CloudFoundry](http://www.cloudfo
44
Bascially, this is just what is described [here](http://blog.cloudfoundry.org/2012/06/18/deploying-tomcat-7-using-the-standalone-framework/) all done for you.
55

66
## Usage
7-
Just
7+
### As a script
8+
If you're working with Maven, read on. Else, just
89

910
$git clone [email protected]:ericbottard/cloudfoundry-tomcat-7.git
1011
$cd cloudfoundry-tomcat-7
1112
<Replace webapps/ROOT with your own app>
1213
$vmc push
1314

15+
### Maven
16+
A tar.gz package of the contents of this repository is being served from [here](http://ericbottard.github.com/cloudfoundry-tomcat-7/org/cloudfoundry/samples/tomcat7-standalone/7.0.29/tomcat7-standalone-7.0.29.tar.gz) making [http://ericbottard.github.com/cloudfoundry-tomcat-7/](http://ericbottard.github.com/cloudfoundry-tomcat-7/) appear as a Maven repository. You can have your project download this package and put your web application in it thanks to the Maven assembly project. Just do the following (maybe using a dedicated Maven profile if you wish):
17+
18+
1. Add `http://ericbottard.github.com/cloudfoundry-tomcat-7` as a Maven repository, either through your repo manager of choice or in your pom.xml:
19+
20+
<repositories>
21+
<repository>
22+
<id>tomcat7-standalone-repo</id>
23+
<url>http://ericbottard.github.com/cloudfoundry-tomcat-7</url>
24+
</repository>
25+
</repositories>
26+
27+
2. Add the following dependency. Use scope provided if you're not using a dedicated profile:
28+
29+
<dependency>
30+
<groupId>org.cloudfoundry.samples</groupId>
31+
<artifactId>tomcat7-standalone</artifactId>
32+
<version>7.0.29</version>
33+
<type>tar.gz</type>
34+
</dependency>
35+
36+
3. Add the following assembly descriptor file in `src/assembly/tomcat7.xml`
37+
38+
<?xml version="1.0"?>
39+
<assembly
40+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
41+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
42+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
43+
<id>tomcat7</id>
44+
45+
<formats>
46+
<format>dir</format>
47+
</formats>
48+
<baseDirectory>/</baseDirectory>
49+
50+
<dependencySets>
51+
<dependencySet>
52+
<outputDirectory>/</outputDirectory>
53+
<unpack>true</unpack>
54+
<includes>
55+
<include>org.cloudfoundry.samples:tomcat7-standalone:tar.gz</include>
56+
</includes>
57+
</dependencySet>
58+
</dependencySets>
59+
<fileSets>
60+
<fileSet>
61+
<directory>${project.build.directory}/${project.build.finalName}</directory>
62+
<outputDirectory>/webapps/ROOT</outputDirectory>
63+
</fileSet>
64+
</fileSets>
65+
</assembly>
66+
67+
4. Configure the assembly plugin to use the file added above:
68+
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-assembly-plugin</artifactId>
72+
<executions>
73+
<execution>
74+
<id>package-inside-tomcat7</id>
75+
<phase>package</phase>
76+
<goals>
77+
<goal>attached</goal>
78+
</goals>
79+
<configuration>
80+
<descriptors>
81+
<descriptor>${basedir}/src/assembly/tomcat7.xml</descriptor>
82+
</descriptors>
83+
<appendAssemblyId>false</appendAssemblyId>
84+
<finalName>tomcat7</finalName>
85+
</configuration>
86+
</execution>
87+
</executions>
88+
</plugin>
89+
90+
Now, when you build your project, you'll get a tomcat 7 distribution already enabled for CloudFoundry with your app set up as `webapps/ROOT` ready to go. You just have to `vmc push --path target/tomcat7`

0 commit comments

Comments
 (0)